{
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5-final"
  },
  "orig_nbformat": 2,
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3.8.5 64-bit ('tf': conda)",
   "metadata": {
    "interpreter": {
     "hash": "2fbf69b50fa6048eb332fb3e351c11a363b1f1fe1319448a5c87ef06287ec5ed"
    }
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2,
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import glob\n",
    "import os\n",
    "import sys"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "['D:\\\\\\\\THU Studies\\\\\\\\Advance Network Management\\\\\\\\Project\\\\\\\\training_data\\\\\\\\2020_05_04\\\\\\\\trace\\\\trace_csf.csv',\n",
       " 'D:\\\\\\\\THU Studies\\\\\\\\Advance Network Management\\\\\\\\Project\\\\\\\\training_data\\\\\\\\2020_05_04\\\\\\\\trace\\\\trace_fly_remote.csv',\n",
       " 'D:\\\\\\\\THU Studies\\\\\\\\Advance Network Management\\\\\\\\Project\\\\\\\\training_data\\\\\\\\2020_05_04\\\\\\\\trace\\\\trace_jdbc.csv',\n",
       " 'D:\\\\\\\\THU Studies\\\\\\\\Advance Network Management\\\\\\\\Project\\\\\\\\training_data\\\\\\\\2020_05_04\\\\\\\\trace\\\\trace_local.csv',\n",
       " 'D:\\\\\\\\THU Studies\\\\\\\\Advance Network Management\\\\\\\\Project\\\\\\\\training_data\\\\\\\\2020_05_04\\\\\\\\trace\\\\trace_osb.csv',\n",
       " 'D:\\\\\\\\THU Studies\\\\\\\\Advance Network Management\\\\\\\\Project\\\\\\\\training_data\\\\\\\\2020_05_04\\\\\\\\trace\\\\trace_remote_process.csv']"
      ]
     },
     "metadata": {},
     "execution_count": 2
    }
   ],
   "source": [
    "path = r'D:\\\\THU Studies\\\\Advance Network Management\\\\Project\\\\training_data\\\\2020_05_04\\\\trace\\\\' # use your path\n",
    "all_files = glob.glob(path + \"*.csv\")\n",
    "all_files"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "['D:\\\\\\\\THU Studies\\\\\\\\Advance Network Management\\\\\\\\Project\\\\\\\\training_data\\\\\\\\2020_05_04\\\\\\\\trace\\\\\\\\unprocessed\\\\CSF.csv',\n",
       " 'D:\\\\\\\\THU Studies\\\\\\\\Advance Network Management\\\\\\\\Project\\\\\\\\training_data\\\\\\\\2020_05_04\\\\\\\\trace\\\\\\\\unprocessed\\\\FlyRemote.csv',\n",
       " 'D:\\\\\\\\THU Studies\\\\\\\\Advance Network Management\\\\\\\\Project\\\\\\\\training_data\\\\\\\\2020_05_04\\\\\\\\trace\\\\\\\\unprocessed\\\\JDBC.csv',\n",
       " 'D:\\\\\\\\THU Studies\\\\\\\\Advance Network Management\\\\\\\\Project\\\\\\\\training_data\\\\\\\\2020_05_04\\\\\\\\trace\\\\\\\\unprocessed\\\\LOCAL.csv',\n",
       " 'D:\\\\\\\\THU Studies\\\\\\\\Advance Network Management\\\\\\\\Project\\\\\\\\training_data\\\\\\\\2020_05_04\\\\\\\\trace\\\\\\\\unprocessed\\\\OSB.csv',\n",
       " 'D:\\\\\\\\THU Studies\\\\\\\\Advance Network Management\\\\\\\\Project\\\\\\\\training_data\\\\\\\\2020_05_04\\\\\\\\trace\\\\\\\\unprocessed\\\\RemoteProcess.csv']"
      ]
     },
     "metadata": {},
     "execution_count": 12
    }
   ],
   "source": [
    "unprocessed_file_path = path + 'unprocessed\\\\'\n",
    "all_files = glob.glob(unprocessed_file_path + \"*.csv\")\n",
    "all_files"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "dfs = []\n",
    "for filename in all_files:\n",
    "    df = pd.read_csv(filename, index_col=None)\n",
    "    dfs.append(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "for df in dfs:\n",
    "    if df['callType'].iloc[0]=='JDBC':\n",
    "        df['serviceName'] = df['dsName']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.concat(dfs, axis=0, ignore_index=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "dfs[0].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "sample_dfs = []\n",
    "for df in dfs:\n",
    "    sample_df = df[(df['startTime']>=1588542600000) & (df['startTime']<= 1588543740000)]\n",
    "    sample_dfs.append(sample_df)\n",
    "    file_path = path + 'unprocessed\\\\' + df['callType'].iloc[0]+'.csv'\n",
    "    sample_df.to_csv(file_path, index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "del dfs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.concat(sample_dfs, axis=0, ignore_index=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "folder = 'D:\\\\THU Studies\\\\Advance Network Management\\\\Project\\\\training_data\\\\2020_05_04\\\\trace\\\\sample\\\\'\n",
    "all_files = glob.glob(folder + \"*.csv\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "dfs = []\n",
    "for filename in all_files:\n",
    "    df = pd.read_csv(filename, index_col=None)\n",
    "    dfs.append(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "for df in dfs:\n",
    "    if df['callType'].iloc[0]=='JDBC':\n",
    "        df['serviceName'] = df['dsName']\n",
    "        df = df.drop(['dsName'], axis=1)\n",
    "    elif df['callType'].iloc[0]=='LOCAL':\n",
    "        df = df.drop(['serviceName'], axis=1)\n",
    "        df['serviceName'] = df['dsName']\n",
    "        df = df.drop(['dsName'], axis=1)\n",
    "    df.to_csv(folder+df['callType'].iloc[0]+'.csv', index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.concat(dfs, axis=0, ignore_index=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "  callType      startTime  elapsedTime  success               traceId  \\\n",
       "0      CSF  1588542600021        523.0     True  cdb40171dc84734e1540   \n",
       "1      CSF  1588542600023        241.0     True  6b62e171dc8473511576   \n",
       "2      CSF  1588542600024        626.0     True  69db7171dc8473512128   \n",
       "3      CSF  1588542600026       1296.0     True  22da1171dc8473512722   \n",
       "4      CSF  1588542600026        248.0     True  8c8d3171dc8473542660   \n",
       "\n",
       "                     id                   pid cmdb_id serviceName dsName  \n",
       "0  8ffc0171dc8473551543  66f0e171dc84734e1541  os_021     csf_001    NaN  \n",
       "1  3e68d171dc8473571579  f0081171dc8473511577  os_021     csf_001    NaN  \n",
       "2  c5172171dc8473582131  087df171dc8473512129  os_021     csf_001    NaN  \n",
       "3  cef8b171dc8473592725  509a7171dc8473512723  os_022     csf_001    NaN  \n",
       "4  718c7171dc84735a2663  aaaab171dc8473542661  os_021     csf_001    NaN  "
      ],
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>callType</th>\n      <th>startTime</th>\n      <th>elapsedTime</th>\n      <th>success</th>\n      <th>traceId</th>\n      <th>id</th>\n      <th>pid</th>\n      <th>cmdb_id</th>\n      <th>serviceName</th>\n      <th>dsName</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>CSF</td>\n      <td>1588542600021</td>\n      <td>523.0</td>\n      <td>True</td>\n      <td>cdb40171dc84734e1540</td>\n      <td>8ffc0171dc8473551543</td>\n      <td>66f0e171dc84734e1541</td>\n      <td>os_021</td>\n      <td>csf_001</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>CSF</td>\n      <td>1588542600023</td>\n      <td>241.0</td>\n      <td>True</td>\n      <td>6b62e171dc8473511576</td>\n      <td>3e68d171dc8473571579</td>\n      <td>f0081171dc8473511577</td>\n      <td>os_021</td>\n      <td>csf_001</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>CSF</td>\n      <td>1588542600024</td>\n      <td>626.0</td>\n      <td>True</td>\n      <td>69db7171dc8473512128</td>\n      <td>c5172171dc8473582131</td>\n      <td>087df171dc8473512129</td>\n      <td>os_021</td>\n      <td>csf_001</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>CSF</td>\n      <td>1588542600026</td>\n      <td>1296.0</td>\n      <td>True</td>\n      <td>22da1171dc8473512722</td>\n      <td>cef8b171dc8473592725</td>\n      <td>509a7171dc8473512723</td>\n      <td>os_022</td>\n      <td>csf_001</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>CSF</td>\n      <td>1588542600026</td>\n      <td>248.0</td>\n      <td>True</td>\n      <td>8c8d3171dc8473542660</td>\n      <td>718c7171dc84735a2663</td>\n      <td>aaaab171dc8473542661</td>\n      <td>os_021</td>\n      <td>csf_001</td>\n      <td>NaN</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 16
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "df['callType'] = pd.Categorical(df['callType'], [\"OSB\", \"CSF\", \"LOCAL\", \"FlyRemote\", \"RemoteProcess\", \"JDBC\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "         callType      startTime  elapsedTime  success               traceId  \\\n",
       "0             OSB  1588543323022        236.0     True  0003b171dc8f7b8e8120   \n",
       "1             CSF  1588543323027        226.0     True  0003b171dc8f7b8e8120   \n",
       "2   RemoteProcess  1588543323027        223.0     True  0003b171dc8f7b8e8120   \n",
       "3       FlyRemote  1588543323030          4.0     True  0003b171dc8f7b8e8120   \n",
       "4             CSF  1588543323036         69.0     True  0003b171dc8f7b8e8120   \n",
       "5   RemoteProcess  1588543323039         65.0     True  0003b171dc8f7b8e8120   \n",
       "6            JDBC  1588543323093          2.0     True  0003b171dc8f7b8e8120   \n",
       "7           LOCAL  1588543323093          6.0     True  0003b171dc8f7b8e8120   \n",
       "8            JDBC  1588543323097          2.0     True  0003b171dc8f7b8e8120   \n",
       "9             CSF  1588543323108         28.0     True  0003b171dc8f7b8e8120   \n",
       "10  RemoteProcess  1588543323110         25.0     True  0003b171dc8f7b8e8120   \n",
       "11           JDBC  1588543323118          2.0     True  0003b171dc8f7b8e8120   \n",
       "12          LOCAL  1588543323118          7.0     True  0003b171dc8f7b8e8120   \n",
       "13           JDBC  1588543323122          3.0     True  0003b171dc8f7b8e8120   \n",
       "14          LOCAL  1588543323126          4.0     True  0003b171dc8f7b8e8120   \n",
       "15           JDBC  1588543323128          2.0     True  0003b171dc8f7b8e8120   \n",
       "16            CSF  1588543323139         22.0     True  0003b171dc8f7b8e8120   \n",
       "17  RemoteProcess  1588543323141         19.0     True  0003b171dc8f7b8e8120   \n",
       "18           JDBC  1588543323144          2.0     True  0003b171dc8f7b8e8120   \n",
       "19          LOCAL  1588543323144          7.0     True  0003b171dc8f7b8e8120   \n",
       "20           JDBC  1588543323148          2.0     True  0003b171dc8f7b8e8120   \n",
       "21          LOCAL  1588543323152          3.0     True  0003b171dc8f7b8e8120   \n",
       "22           JDBC  1588543323153          2.0     True  0003b171dc8f7b8e8120   \n",
       "23            CSF  1588543323163         24.0     True  0003b171dc8f7b8e8120   \n",
       "24  RemoteProcess  1588543323166         20.0     True  0003b171dc8f7b8e8120   \n",
       "25           JDBC  1588543323173          2.0     True  0003b171dc8f7b8e8120   \n",
       "26          LOCAL  1588543323173          7.0     True  0003b171dc8f7b8e8120   \n",
       "27           JDBC  1588543323178          2.0     True  0003b171dc8f7b8e8120   \n",
       "28           JDBC  1588543323188          1.0     True  0003b171dc8f7b8e8120   \n",
       "29          LOCAL  1588543323188          2.0     True  0003b171dc8f7b8e8120   \n",
       "30           JDBC  1588543323190          0.0     True  0003b171dc8f7b8e8120   \n",
       "31          LOCAL  1588543323190          3.0     True  0003b171dc8f7b8e8120   \n",
       "32           JDBC  1588543323192          1.0     True  0003b171dc8f7b8e8120   \n",
       "33          LOCAL  1588543323193          3.0     True  0003b171dc8f7b8e8120   \n",
       "34           JDBC  1588543323195          0.0     True  0003b171dc8f7b8e8120   \n",
       "35          LOCAL  1588543323196          2.0     True  0003b171dc8f7b8e8120   \n",
       "36           JDBC  1588543323197          0.0     True  0003b171dc8f7b8e8120   \n",
       "37          LOCAL  1588543323198          2.0     True  0003b171dc8f7b8e8120   \n",
       "38           JDBC  1588543323199          1.0     True  0003b171dc8f7b8e8120   \n",
       "39          LOCAL  1588543323200          2.0     True  0003b171dc8f7b8e8120   \n",
       "40           JDBC  1588543323201          1.0     True  0003b171dc8f7b8e8120   \n",
       "41          LOCAL  1588543323202          2.0     True  0003b171dc8f7b8e8120   \n",
       "42           JDBC  1588543323203          1.0     True  0003b171dc8f7b8e8120   \n",
       "43          LOCAL  1588543323204          2.0     True  0003b171dc8f7b8e8120   \n",
       "44           JDBC  1588543323205          0.0     True  0003b171dc8f7b8e8120   \n",
       "45          LOCAL  1588543323206          1.0     True  0003b171dc8f7b8e8120   \n",
       "46           JDBC  1588543323207          0.0     True  0003b171dc8f7b8e8120   \n",
       "47          LOCAL  1588543323207          2.0     True  0003b171dc8f7b8e8120   \n",
       "48           JDBC  1588543323208          0.0     True  0003b171dc8f7b8e8120   \n",
       "49          LOCAL  1588543323209          1.0     True  0003b171dc8f7b8e8120   \n",
       "50           JDBC  1588543323210          0.0     True  0003b171dc8f7b8e8120   \n",
       "51          LOCAL  1588543323210          2.0     True  0003b171dc8f7b8e8120   \n",
       "52           JDBC  1588543323211          0.0     True  0003b171dc8f7b8e8120   \n",
       "53          LOCAL  1588543323212          1.0     True  0003b171dc8f7b8e8120   \n",
       "54           JDBC  1588543323213          0.0     True  0003b171dc8f7b8e8120   \n",
       "55           JDBC  1588543323214          2.0     True  0003b171dc8f7b8e8120   \n",
       "56          LOCAL  1588543323214         28.0     True  0003b171dc8f7b8e8120   \n",
       "57           JDBC  1588543323239          3.0     True  0003b171dc8f7b8e8120   \n",
       "58            OSB  1588542852703        196.0     True  0007c171dc884e5f3592   \n",
       "59            CSF  1588542852708        182.0     True  0007c171dc884e5f3592   \n",
       "\n",
       "                      id                   pid     cmdb_id       serviceName  \\\n",
       "0   dea5d171dc8f7b8e8121                  None      os_021           osb_001   \n",
       "1   f1be6171dc8f7b938125  dea5d171dc8f7b8e8121      os_021           csf_001   \n",
       "2   04aec171dc8f7b935561  f1be6171dc8f7b938125  docker_003           csf_001   \n",
       "3   904e1171dc8f7b965563  04aec171dc8f7b935561  docker_003    fly_remote_001   \n",
       "4   b40a2171dc8f7b9c5565  04aec171dc8f7b935561  docker_003           csf_002   \n",
       "5   26db7171dc8f7b9f5058  b40a2171dc8f7b9c5565  docker_006           csf_002   \n",
       "6   f0c8e171dc8f7bd55075  aec14171dc8f7bd55072  docker_006            db_003   \n",
       "7   aec14171dc8f7bd55072  26db7171dc8f7b9f5058  docker_006  local_method_011   \n",
       "8   e73ac171dc8f7bd95083  aec14171dc8f7bd55072  docker_006            db_003   \n",
       "9   f1e41171dc8f7be35567  04aec171dc8f7b935561  docker_003           csf_003   \n",
       "10  08790171dc8f7be65090  f1e41171dc8f7be35567  docker_006           csf_003   \n",
       "11  b9b80171dc8f7bee5104  545ba171dc8f7bee5101  docker_006            db_003   \n",
       "12  545ba171dc8f7bee5101  08790171dc8f7be65090  docker_006  local_method_013   \n",
       "13  9ffc2171dc8f7bf25107  545ba171dc8f7bee5101  docker_006            db_003   \n",
       "14  ee408171dc8f7bf65112  08790171dc8f7be65090  docker_006  local_method_014   \n",
       "15  93b09171dc8f7bf85117  ee408171dc8f7bf65112  docker_006            db_003   \n",
       "16  576ac171dc8f7c025569  04aec171dc8f7b935561  docker_003           csf_004   \n",
       "17  60a3a171dc8f7c055126  576ac171dc8f7c025569  docker_006           csf_004   \n",
       "18  7fabb171dc8f7c085135  c25d3171dc8f7c085132  docker_006            db_003   \n",
       "19  c25d3171dc8f7c085132  60a3a171dc8f7c055126  docker_006  local_method_015   \n",
       "20  f3530171dc8f7c0c5145  c25d3171dc8f7c085132  docker_006            db_003   \n",
       "21  4e082171dc8f7c105150  60a3a171dc8f7c055126  docker_006  local_method_016   \n",
       "22  3dfd8171dc8f7c115153  4e082171dc8f7c105150  docker_006            db_003   \n",
       "23  1d4cb171dc8f7c1b5571  04aec171dc8f7b935561  docker_003           csf_005   \n",
       "24  374bb171dc8f7c1e5160  1d4cb171dc8f7c1b5571  docker_006           csf_005   \n",
       "25  b731b171dc8f7c255167  a510c171dc8f7c255164  docker_006            db_003   \n",
       "26  a510c171dc8f7c255164  374bb171dc8f7c1e5160  docker_006  local_method_017   \n",
       "27  7d568171dc8f7c2a5178  a510c171dc8f7c255164  docker_006            db_003   \n",
       "28  aa8ef171dc8f7c345576  398fa171dc8f7c345573  docker_003            db_009   \n",
       "29  398fa171dc8f7c345573  04aec171dc8f7b935561  docker_003  local_method_001   \n",
       "30  cdd4c171dc8f7c365579  398fa171dc8f7c345573  docker_003            db_009   \n",
       "31  7f978171dc8f7c365581  04aec171dc8f7b935561  docker_003  local_method_002   \n",
       "32  275fe171dc8f7c385584  7f978171dc8f7c365581  docker_003            db_009   \n",
       "33  595d1171dc8f7c395586  04aec171dc8f7b935561  docker_003  local_method_002   \n",
       "34  3fd9c171dc8f7c3b5589  595d1171dc8f7c395586  docker_003            db_009   \n",
       "35  b59f1171dc8f7c3c5591  04aec171dc8f7b935561  docker_003  local_method_003   \n",
       "36  347a3171dc8f7c3d5594  b59f1171dc8f7c3c5591  docker_003            db_009   \n",
       "37  3e028171dc8f7c3e5596  04aec171dc8f7b935561  docker_003  local_method_004   \n",
       "38  131b2171dc8f7c3f5599  3e028171dc8f7c3e5596  docker_003            db_009   \n",
       "39  f600e171dc8f7c405601  04aec171dc8f7b935561  docker_003  local_method_004   \n",
       "40  b82c8171dc8f7c415604  f600e171dc8f7c405601  docker_003            db_009   \n",
       "41  c9994171dc8f7c425606  04aec171dc8f7b935561  docker_003  local_method_004   \n",
       "42  a880d171dc8f7c435609  c9994171dc8f7c425606  docker_003            db_009   \n",
       "43  02ff7171dc8f7c445611  04aec171dc8f7b935561  docker_003  local_method_004   \n",
       "44  98cc5171dc8f7c455614  02ff7171dc8f7c445611  docker_003            db_009   \n",
       "45  78287171dc8f7c465616  04aec171dc8f7b935561  docker_003  local_method_005   \n",
       "46  beb89171dc8f7c475619  78287171dc8f7c465616  docker_003            db_009   \n",
       "47  6c2e3171dc8f7c475621  04aec171dc8f7b935561  docker_003  local_method_006   \n",
       "48  3a2bf171dc8f7c485624  6c2e3171dc8f7c475621  docker_003            db_009   \n",
       "49  1f403171dc8f7c495626  04aec171dc8f7b935561  docker_003  local_method_007   \n",
       "50  feb91171dc8f7c4a5629  1f403171dc8f7c495626  docker_003            db_009   \n",
       "51  17908171dc8f7c4a5631  04aec171dc8f7b935561  docker_003  local_method_006   \n",
       "52  3a339171dc8f7c4b5634  17908171dc8f7c4a5631  docker_003            db_009   \n",
       "53  fe4ca171dc8f7c4c5636  04aec171dc8f7b935561  docker_003  local_method_009   \n",
       "54  40603171dc8f7c4d5639  fe4ca171dc8f7c4c5636  docker_003            db_009   \n",
       "55  222db171dc8f7c4e5644  36f3c171dc8f7c4e5641  docker_003            db_007   \n",
       "56  36f3c171dc8f7c4e5641  04aec171dc8f7b935561  docker_003  local_method_010   \n",
       "57  728d4171dc8f7c675647  36f3c171dc8f7c4e5641  docker_003            db_007   \n",
       "58  08f8c171dc884e5f3593                  None      os_021           osb_001   \n",
       "59  abe9c171dc884e643595  08f8c171dc884e5f3593      os_021           csf_001   \n",
       "\n",
       "    dsName  \n",
       "0      NaN  \n",
       "1      NaN  \n",
       "2      NaN  \n",
       "3      NaN  \n",
       "4      NaN  \n",
       "5      NaN  \n",
       "6   db_003  \n",
       "7   db_003  \n",
       "8   db_003  \n",
       "9      NaN  \n",
       "10     NaN  \n",
       "11  db_003  \n",
       "12  db_003  \n",
       "13  db_003  \n",
       "14  db_003  \n",
       "15  db_003  \n",
       "16     NaN  \n",
       "17     NaN  \n",
       "18  db_003  \n",
       "19  db_003  \n",
       "20  db_003  \n",
       "21  db_003  \n",
       "22  db_003  \n",
       "23     NaN  \n",
       "24     NaN  \n",
       "25  db_003  \n",
       "26  db_003  \n",
       "27  db_003  \n",
       "28  db_009  \n",
       "29  db_009  \n",
       "30  db_009  \n",
       "31  db_009  \n",
       "32  db_009  \n",
       "33  db_009  \n",
       "34  db_009  \n",
       "35  db_009  \n",
       "36  db_009  \n",
       "37  db_009  \n",
       "38  db_009  \n",
       "39  db_009  \n",
       "40  db_009  \n",
       "41  db_009  \n",
       "42  db_009  \n",
       "43  db_009  \n",
       "44  db_009  \n",
       "45  db_009  \n",
       "46  db_009  \n",
       "47  db_009  \n",
       "48  db_009  \n",
       "49  db_009  \n",
       "50  db_009  \n",
       "51  db_009  \n",
       "52  db_009  \n",
       "53  db_009  \n",
       "54  db_009  \n",
       "55  db_007  \n",
       "56  db_007  \n",
       "57  db_007  \n",
       "58     NaN  \n",
       "59     NaN  "
      ],
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>callType</th>\n      <th>startTime</th>\n      <th>elapsedTime</th>\n      <th>success</th>\n      <th>traceId</th>\n      <th>id</th>\n      <th>pid</th>\n      <th>cmdb_id</th>\n      <th>serviceName</th>\n      <th>dsName</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>OSB</td>\n      <td>1588543323022</td>\n      <td>236.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>dea5d171dc8f7b8e8121</td>\n      <td>None</td>\n      <td>os_021</td>\n      <td>osb_001</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>CSF</td>\n      <td>1588543323027</td>\n      <td>226.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>f1be6171dc8f7b938125</td>\n      <td>dea5d171dc8f7b8e8121</td>\n      <td>os_021</td>\n      <td>csf_001</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>RemoteProcess</td>\n      <td>1588543323027</td>\n      <td>223.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>f1be6171dc8f7b938125</td>\n      <td>docker_003</td>\n      <td>csf_001</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>FlyRemote</td>\n      <td>1588543323030</td>\n      <td>4.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>904e1171dc8f7b965563</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>fly_remote_001</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>CSF</td>\n      <td>1588543323036</td>\n      <td>69.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>b40a2171dc8f7b9c5565</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>csf_002</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>RemoteProcess</td>\n      <td>1588543323039</td>\n      <td>65.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>26db7171dc8f7b9f5058</td>\n      <td>b40a2171dc8f7b9c5565</td>\n      <td>docker_006</td>\n      <td>csf_002</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>JDBC</td>\n      <td>1588543323093</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>f0c8e171dc8f7bd55075</td>\n      <td>aec14171dc8f7bd55072</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>LOCAL</td>\n      <td>1588543323093</td>\n      <td>6.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>aec14171dc8f7bd55072</td>\n      <td>26db7171dc8f7b9f5058</td>\n      <td>docker_006</td>\n      <td>local_method_011</td>\n      <td>db_003</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>JDBC</td>\n      <td>1588543323097</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>e73ac171dc8f7bd95083</td>\n      <td>aec14171dc8f7bd55072</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>CSF</td>\n      <td>1588543323108</td>\n      <td>28.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>f1e41171dc8f7be35567</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>csf_003</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>RemoteProcess</td>\n      <td>1588543323110</td>\n      <td>25.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>08790171dc8f7be65090</td>\n      <td>f1e41171dc8f7be35567</td>\n      <td>docker_006</td>\n      <td>csf_003</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>JDBC</td>\n      <td>1588543323118</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>b9b80171dc8f7bee5104</td>\n      <td>545ba171dc8f7bee5101</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>LOCAL</td>\n      <td>1588543323118</td>\n      <td>7.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>545ba171dc8f7bee5101</td>\n      <td>08790171dc8f7be65090</td>\n      <td>docker_006</td>\n      <td>local_method_013</td>\n      <td>db_003</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>JDBC</td>\n      <td>1588543323122</td>\n      <td>3.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>9ffc2171dc8f7bf25107</td>\n      <td>545ba171dc8f7bee5101</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n    </tr>\n    <tr>\n      <th>14</th>\n      <td>LOCAL</td>\n      <td>1588543323126</td>\n      <td>4.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>ee408171dc8f7bf65112</td>\n      <td>08790171dc8f7be65090</td>\n      <td>docker_006</td>\n      <td>local_method_014</td>\n      <td>db_003</td>\n    </tr>\n    <tr>\n      <th>15</th>\n      <td>JDBC</td>\n      <td>1588543323128</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>93b09171dc8f7bf85117</td>\n      <td>ee408171dc8f7bf65112</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n    </tr>\n    <tr>\n      <th>16</th>\n      <td>CSF</td>\n      <td>1588543323139</td>\n      <td>22.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>576ac171dc8f7c025569</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>csf_004</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>17</th>\n      <td>RemoteProcess</td>\n      <td>1588543323141</td>\n      <td>19.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>60a3a171dc8f7c055126</td>\n      <td>576ac171dc8f7c025569</td>\n      <td>docker_006</td>\n      <td>csf_004</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>18</th>\n      <td>JDBC</td>\n      <td>1588543323144</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>7fabb171dc8f7c085135</td>\n      <td>c25d3171dc8f7c085132</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n    </tr>\n    <tr>\n      <th>19</th>\n      <td>LOCAL</td>\n      <td>1588543323144</td>\n      <td>7.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>c25d3171dc8f7c085132</td>\n      <td>60a3a171dc8f7c055126</td>\n      <td>docker_006</td>\n      <td>local_method_015</td>\n      <td>db_003</td>\n    </tr>\n    <tr>\n      <th>20</th>\n      <td>JDBC</td>\n      <td>1588543323148</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>f3530171dc8f7c0c5145</td>\n      <td>c25d3171dc8f7c085132</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n    </tr>\n    <tr>\n      <th>21</th>\n      <td>LOCAL</td>\n      <td>1588543323152</td>\n      <td>3.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>4e082171dc8f7c105150</td>\n      <td>60a3a171dc8f7c055126</td>\n      <td>docker_006</td>\n      <td>local_method_016</td>\n      <td>db_003</td>\n    </tr>\n    <tr>\n      <th>22</th>\n      <td>JDBC</td>\n      <td>1588543323153</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>3dfd8171dc8f7c115153</td>\n      <td>4e082171dc8f7c105150</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n    </tr>\n    <tr>\n      <th>23</th>\n      <td>CSF</td>\n      <td>1588543323163</td>\n      <td>24.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>1d4cb171dc8f7c1b5571</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>csf_005</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>24</th>\n      <td>RemoteProcess</td>\n      <td>1588543323166</td>\n      <td>20.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>374bb171dc8f7c1e5160</td>\n      <td>1d4cb171dc8f7c1b5571</td>\n      <td>docker_006</td>\n      <td>csf_005</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>25</th>\n      <td>JDBC</td>\n      <td>1588543323173</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>b731b171dc8f7c255167</td>\n      <td>a510c171dc8f7c255164</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n    </tr>\n    <tr>\n      <th>26</th>\n      <td>LOCAL</td>\n      <td>1588543323173</td>\n      <td>7.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>a510c171dc8f7c255164</td>\n      <td>374bb171dc8f7c1e5160</td>\n      <td>docker_006</td>\n      <td>local_method_017</td>\n      <td>db_003</td>\n    </tr>\n    <tr>\n      <th>27</th>\n      <td>JDBC</td>\n      <td>1588543323178</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>7d568171dc8f7c2a5178</td>\n      <td>a510c171dc8f7c255164</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n    </tr>\n    <tr>\n      <th>28</th>\n      <td>JDBC</td>\n      <td>1588543323188</td>\n      <td>1.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>aa8ef171dc8f7c345576</td>\n      <td>398fa171dc8f7c345573</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>29</th>\n      <td>LOCAL</td>\n      <td>1588543323188</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>398fa171dc8f7c345573</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_001</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>30</th>\n      <td>JDBC</td>\n      <td>1588543323190</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>cdd4c171dc8f7c365579</td>\n      <td>398fa171dc8f7c345573</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>31</th>\n      <td>LOCAL</td>\n      <td>1588543323190</td>\n      <td>3.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>7f978171dc8f7c365581</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_002</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>32</th>\n      <td>JDBC</td>\n      <td>1588543323192</td>\n      <td>1.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>275fe171dc8f7c385584</td>\n      <td>7f978171dc8f7c365581</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>33</th>\n      <td>LOCAL</td>\n      <td>1588543323193</td>\n      <td>3.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>595d1171dc8f7c395586</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_002</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>34</th>\n      <td>JDBC</td>\n      <td>1588543323195</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>3fd9c171dc8f7c3b5589</td>\n      <td>595d1171dc8f7c395586</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>35</th>\n      <td>LOCAL</td>\n      <td>1588543323196</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>b59f1171dc8f7c3c5591</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_003</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>36</th>\n      <td>JDBC</td>\n      <td>1588543323197</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>347a3171dc8f7c3d5594</td>\n      <td>b59f1171dc8f7c3c5591</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>37</th>\n      <td>LOCAL</td>\n      <td>1588543323198</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>3e028171dc8f7c3e5596</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_004</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>38</th>\n      <td>JDBC</td>\n      <td>1588543323199</td>\n      <td>1.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>131b2171dc8f7c3f5599</td>\n      <td>3e028171dc8f7c3e5596</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>39</th>\n      <td>LOCAL</td>\n      <td>1588543323200</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>f600e171dc8f7c405601</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_004</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>40</th>\n      <td>JDBC</td>\n      <td>1588543323201</td>\n      <td>1.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>b82c8171dc8f7c415604</td>\n      <td>f600e171dc8f7c405601</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>41</th>\n      <td>LOCAL</td>\n      <td>1588543323202</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>c9994171dc8f7c425606</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_004</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>42</th>\n      <td>JDBC</td>\n      <td>1588543323203</td>\n      <td>1.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>a880d171dc8f7c435609</td>\n      <td>c9994171dc8f7c425606</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>43</th>\n      <td>LOCAL</td>\n      <td>1588543323204</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>02ff7171dc8f7c445611</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_004</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>44</th>\n      <td>JDBC</td>\n      <td>1588543323205</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>98cc5171dc8f7c455614</td>\n      <td>02ff7171dc8f7c445611</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>45</th>\n      <td>LOCAL</td>\n      <td>1588543323206</td>\n      <td>1.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>78287171dc8f7c465616</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_005</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>46</th>\n      <td>JDBC</td>\n      <td>1588543323207</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>beb89171dc8f7c475619</td>\n      <td>78287171dc8f7c465616</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>47</th>\n      <td>LOCAL</td>\n      <td>1588543323207</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>6c2e3171dc8f7c475621</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_006</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>48</th>\n      <td>JDBC</td>\n      <td>1588543323208</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>3a2bf171dc8f7c485624</td>\n      <td>6c2e3171dc8f7c475621</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>49</th>\n      <td>LOCAL</td>\n      <td>1588543323209</td>\n      <td>1.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>1f403171dc8f7c495626</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_007</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>50</th>\n      <td>JDBC</td>\n      <td>1588543323210</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>feb91171dc8f7c4a5629</td>\n      <td>1f403171dc8f7c495626</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>51</th>\n      <td>LOCAL</td>\n      <td>1588543323210</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>17908171dc8f7c4a5631</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_006</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>52</th>\n      <td>JDBC</td>\n      <td>1588543323211</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>3a339171dc8f7c4b5634</td>\n      <td>17908171dc8f7c4a5631</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>53</th>\n      <td>LOCAL</td>\n      <td>1588543323212</td>\n      <td>1.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>fe4ca171dc8f7c4c5636</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_009</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>54</th>\n      <td>JDBC</td>\n      <td>1588543323213</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>40603171dc8f7c4d5639</td>\n      <td>fe4ca171dc8f7c4c5636</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n    </tr>\n    <tr>\n      <th>55</th>\n      <td>JDBC</td>\n      <td>1588543323214</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>222db171dc8f7c4e5644</td>\n      <td>36f3c171dc8f7c4e5641</td>\n      <td>docker_003</td>\n      <td>db_007</td>\n      <td>db_007</td>\n    </tr>\n    <tr>\n      <th>56</th>\n      <td>LOCAL</td>\n      <td>1588543323214</td>\n      <td>28.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>36f3c171dc8f7c4e5641</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_010</td>\n      <td>db_007</td>\n    </tr>\n    <tr>\n      <th>57</th>\n      <td>JDBC</td>\n      <td>1588543323239</td>\n      <td>3.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>728d4171dc8f7c675647</td>\n      <td>36f3c171dc8f7c4e5641</td>\n      <td>docker_003</td>\n      <td>db_007</td>\n      <td>db_007</td>\n    </tr>\n    <tr>\n      <th>58</th>\n      <td>OSB</td>\n      <td>1588542852703</td>\n      <td>196.0</td>\n      <td>True</td>\n      <td>0007c171dc884e5f3592</td>\n      <td>08f8c171dc884e5f3593</td>\n      <td>None</td>\n      <td>os_021</td>\n      <td>osb_001</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>59</th>\n      <td>CSF</td>\n      <td>1588542852708</td>\n      <td>182.0</td>\n      <td>True</td>\n      <td>0007c171dc884e5f3592</td>\n      <td>abe9c171dc884e643595</td>\n      <td>08f8c171dc884e5f3593</td>\n      <td>os_021</td>\n      <td>csf_001</td>\n      <td>NaN</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 18
    }
   ],
   "source": [
    "df = df.sort_values([\"traceId\",\"startTime\"], ignore_index=True)\n",
    "df.head(60)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "metadata": {},
     "execution_count": 16
    }
   ],
   "source": [
    "len(df.id.unique()) == len(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "    callType      startTime  elapsedTime  success               traceId  \\\n",
       "1        CSF  1588543323027        226.0     True  0003b171dc8f7b8e8120   \n",
       "4        CSF  1588543323036         69.0     True  0003b171dc8f7b8e8120   \n",
       "9        CSF  1588543323108         28.0     True  0003b171dc8f7b8e8120   \n",
       "16       CSF  1588543323139         22.0     True  0003b171dc8f7b8e8120   \n",
       "23       CSF  1588543323163         24.0     True  0003b171dc8f7b8e8120   \n",
       "59       CSF  1588542852708        182.0     True  0007c171dc884e5f3592   \n",
       "62       CSF  1588542852752         33.0     True  0007c171dc884e5f3592   \n",
       "67       CSF  1588542852786         21.0     True  0007c171dc884e5f3592   \n",
       "74       CSF  1588542852810         24.0     True  0007c171dc884e5f3592   \n",
       "81       CSF  1588542852835         20.0     True  0007c171dc884e5f3592   \n",
       "117      CSF  1588543205595        351.0     True  00082171dc8db0d56370   \n",
       "120      CSF  1588543205639         43.0     True  00082171dc8db0d56370   \n",
       "125      CSF  1588543205685         24.0     True  00082171dc8db0d56370   \n",
       "132      CSF  1588543205710         29.0     True  00082171dc8db0d56370   \n",
       "139      CSF  1588543205741         27.0     True  00082171dc8db0d56370   \n",
       "175      CSF  1588542984911        241.0     True  00136171dc8a52c75530   \n",
       "178      CSF  1588542984922         34.0     True  00136171dc8a52c75530   \n",
       "183      CSF  1588542984957         27.0     True  00136171dc8a52c75530   \n",
       "190      CSF  1588542984986         24.0     True  00136171dc8a52c75530   \n",
       "197      CSF  1588542985013         19.0     True  00136171dc8a52c75530   \n",
       "\n",
       "                       id                   pid     cmdb_id serviceName  \n",
       "1    f1be6171dc8f7b938125  dea5d171dc8f7b8e8121      os_021     csf_001  \n",
       "4    b40a2171dc8f7b9c5565  04aec171dc8f7b935561  docker_003     csf_002  \n",
       "9    f1e41171dc8f7be35567  04aec171dc8f7b935561  docker_003     csf_003  \n",
       "16   576ac171dc8f7c025569  04aec171dc8f7b935561  docker_003     csf_004  \n",
       "23   1d4cb171dc8f7c1b5571  04aec171dc8f7b935561  docker_003     csf_005  \n",
       "59   abe9c171dc884e643595  08f8c171dc884e5f3593      os_021     csf_001  \n",
       "62   98958171dc884e901653  fb409171dc884e851628  docker_003     csf_002  \n",
       "67   259f8171dc884eb21655  fb409171dc884e851628  docker_003     csf_003  \n",
       "74   59882171dc884eca1663  fb409171dc884e851628  docker_003     csf_004  \n",
       "81   6af80171dc884ee31665  fb409171dc884e851628  docker_003     csf_005  \n",
       "117  dc685171dc8db0db6373  8271a171dc8db0d66371      os_021     csf_001  \n",
       "120  9a086171dc8db0e53616  e45e0171dc8db0db3612  docker_003     csf_002  \n",
       "125  9e4fe171dc8db1343628  e45e0171dc8db0db3612  docker_003     csf_003  \n",
       "132  ca121171dc8db14e3632  e45e0171dc8db0db3612  docker_003     csf_004  \n",
       "139  41e87171dc8db16d3636  e45e0171dc8db0db3612  docker_003     csf_005  \n",
       "175  2aa52171dc8a52cf5533  0f62a171dc8a52c75531      os_022     csf_001  \n",
       "178  52530171dc8a52da8606  d41f9171dc8a52cf8602  docker_001     csf_002  \n",
       "183  c24b1171dc8a52fd8610  d41f9171dc8a52cf8602  docker_001     csf_003  \n",
       "190  d1c00171dc8a531a8614  d41f9171dc8a52cf8602  docker_001     csf_004  \n",
       "197  9b8a1171dc8a53348618  d41f9171dc8a52cf8602  docker_001     csf_005  "
      ],
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>callType</th>\n      <th>startTime</th>\n      <th>elapsedTime</th>\n      <th>success</th>\n      <th>traceId</th>\n      <th>id</th>\n      <th>pid</th>\n      <th>cmdb_id</th>\n      <th>serviceName</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>1</th>\n      <td>CSF</td>\n      <td>1588543323027</td>\n      <td>226.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>f1be6171dc8f7b938125</td>\n      <td>dea5d171dc8f7b8e8121</td>\n      <td>os_021</td>\n      <td>csf_001</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>CSF</td>\n      <td>1588543323036</td>\n      <td>69.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>b40a2171dc8f7b9c5565</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>csf_002</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>CSF</td>\n      <td>1588543323108</td>\n      <td>28.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>f1e41171dc8f7be35567</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>csf_003</td>\n    </tr>\n    <tr>\n      <th>16</th>\n      <td>CSF</td>\n      <td>1588543323139</td>\n      <td>22.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>576ac171dc8f7c025569</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>csf_004</td>\n    </tr>\n    <tr>\n      <th>23</th>\n      <td>CSF</td>\n      <td>1588543323163</td>\n      <td>24.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>1d4cb171dc8f7c1b5571</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>csf_005</td>\n    </tr>\n    <tr>\n      <th>59</th>\n      <td>CSF</td>\n      <td>1588542852708</td>\n      <td>182.0</td>\n      <td>True</td>\n      <td>0007c171dc884e5f3592</td>\n      <td>abe9c171dc884e643595</td>\n      <td>08f8c171dc884e5f3593</td>\n      <td>os_021</td>\n      <td>csf_001</td>\n    </tr>\n    <tr>\n      <th>62</th>\n      <td>CSF</td>\n      <td>1588542852752</td>\n      <td>33.0</td>\n      <td>True</td>\n      <td>0007c171dc884e5f3592</td>\n      <td>98958171dc884e901653</td>\n      <td>fb409171dc884e851628</td>\n      <td>docker_003</td>\n      <td>csf_002</td>\n    </tr>\n    <tr>\n      <th>67</th>\n      <td>CSF</td>\n      <td>1588542852786</td>\n      <td>21.0</td>\n      <td>True</td>\n      <td>0007c171dc884e5f3592</td>\n      <td>259f8171dc884eb21655</td>\n      <td>fb409171dc884e851628</td>\n      <td>docker_003</td>\n      <td>csf_003</td>\n    </tr>\n    <tr>\n      <th>74</th>\n      <td>CSF</td>\n      <td>1588542852810</td>\n      <td>24.0</td>\n      <td>True</td>\n      <td>0007c171dc884e5f3592</td>\n      <td>59882171dc884eca1663</td>\n      <td>fb409171dc884e851628</td>\n      <td>docker_003</td>\n      <td>csf_004</td>\n    </tr>\n    <tr>\n      <th>81</th>\n      <td>CSF</td>\n      <td>1588542852835</td>\n      <td>20.0</td>\n      <td>True</td>\n      <td>0007c171dc884e5f3592</td>\n      <td>6af80171dc884ee31665</td>\n      <td>fb409171dc884e851628</td>\n      <td>docker_003</td>\n      <td>csf_005</td>\n    </tr>\n    <tr>\n      <th>117</th>\n      <td>CSF</td>\n      <td>1588543205595</td>\n      <td>351.0</td>\n      <td>True</td>\n      <td>00082171dc8db0d56370</td>\n      <td>dc685171dc8db0db6373</td>\n      <td>8271a171dc8db0d66371</td>\n      <td>os_021</td>\n      <td>csf_001</td>\n    </tr>\n    <tr>\n      <th>120</th>\n      <td>CSF</td>\n      <td>1588543205639</td>\n      <td>43.0</td>\n      <td>True</td>\n      <td>00082171dc8db0d56370</td>\n      <td>9a086171dc8db0e53616</td>\n      <td>e45e0171dc8db0db3612</td>\n      <td>docker_003</td>\n      <td>csf_002</td>\n    </tr>\n    <tr>\n      <th>125</th>\n      <td>CSF</td>\n      <td>1588543205685</td>\n      <td>24.0</td>\n      <td>True</td>\n      <td>00082171dc8db0d56370</td>\n      <td>9e4fe171dc8db1343628</td>\n      <td>e45e0171dc8db0db3612</td>\n      <td>docker_003</td>\n      <td>csf_003</td>\n    </tr>\n    <tr>\n      <th>132</th>\n      <td>CSF</td>\n      <td>1588543205710</td>\n      <td>29.0</td>\n      <td>True</td>\n      <td>00082171dc8db0d56370</td>\n      <td>ca121171dc8db14e3632</td>\n      <td>e45e0171dc8db0db3612</td>\n      <td>docker_003</td>\n      <td>csf_004</td>\n    </tr>\n    <tr>\n      <th>139</th>\n      <td>CSF</td>\n      <td>1588543205741</td>\n      <td>27.0</td>\n      <td>True</td>\n      <td>00082171dc8db0d56370</td>\n      <td>41e87171dc8db16d3636</td>\n      <td>e45e0171dc8db0db3612</td>\n      <td>docker_003</td>\n      <td>csf_005</td>\n    </tr>\n    <tr>\n      <th>175</th>\n      <td>CSF</td>\n      <td>1588542984911</td>\n      <td>241.0</td>\n      <td>True</td>\n      <td>00136171dc8a52c75530</td>\n      <td>2aa52171dc8a52cf5533</td>\n      <td>0f62a171dc8a52c75531</td>\n      <td>os_022</td>\n      <td>csf_001</td>\n    </tr>\n    <tr>\n      <th>178</th>\n      <td>CSF</td>\n      <td>1588542984922</td>\n      <td>34.0</td>\n      <td>True</td>\n      <td>00136171dc8a52c75530</td>\n      <td>52530171dc8a52da8606</td>\n      <td>d41f9171dc8a52cf8602</td>\n      <td>docker_001</td>\n      <td>csf_002</td>\n    </tr>\n    <tr>\n      <th>183</th>\n      <td>CSF</td>\n      <td>1588542984957</td>\n      <td>27.0</td>\n      <td>True</td>\n      <td>00136171dc8a52c75530</td>\n      <td>c24b1171dc8a52fd8610</td>\n      <td>d41f9171dc8a52cf8602</td>\n      <td>docker_001</td>\n      <td>csf_003</td>\n    </tr>\n    <tr>\n      <th>190</th>\n      <td>CSF</td>\n      <td>1588542984986</td>\n      <td>24.0</td>\n      <td>True</td>\n      <td>00136171dc8a52c75530</td>\n      <td>d1c00171dc8a531a8614</td>\n      <td>d41f9171dc8a52cf8602</td>\n      <td>docker_001</td>\n      <td>csf_004</td>\n    </tr>\n    <tr>\n      <th>197</th>\n      <td>CSF</td>\n      <td>1588542985013</td>\n      <td>19.0</td>\n      <td>True</td>\n      <td>00136171dc8a52c75530</td>\n      <td>9b8a1171dc8a53348618</td>\n      <td>d41f9171dc8a52cf8602</td>\n      <td>docker_001</td>\n      <td>csf_005</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 18
    }
   ],
   "source": [
    "df[df['callType']=='CSF'].head(20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = [15.116,4.584,3.382,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "elapse_time = {}\n",
    "children = {}\n",
    "for index, row in df.iterrows():\n",
    "    if row['pid'] != 'None':\n",
    "        if row['pid'] in children.keys():\n",
    "            children[row['pid']].append(row['id'])\n",
    "        else:\n",
    "            children[row['pid']] = [row['id']]\n",
    "    elapse_time [row['id']] = float(row['elapsedTime'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "    callType      startTime  elapsedTime  success               traceId  \\\n",
       "3  FlyRemote  1588543323030          4.0     True  0003b171dc8f7b8e8120   \n",
       "\n",
       "                     id                   pid     cmdb_id     serviceName  \\\n",
       "3  904e1171dc8f7b965563  04aec171dc8f7b935561  docker_003  fly_remote_001   \n",
       "\n",
       "   actual_time  \n",
       "3            0  "
      ],
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>callType</th>\n      <th>startTime</th>\n      <th>elapsedTime</th>\n      <th>success</th>\n      <th>traceId</th>\n      <th>id</th>\n      <th>pid</th>\n      <th>cmdb_id</th>\n      <th>serviceName</th>\n      <th>actual_time</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>3</th>\n      <td>FlyRemote</td>\n      <td>1588543323030</td>\n      <td>4.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>904e1171dc8f7b965563</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>fly_remote_001</td>\n      <td>0</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 31
    }
   ],
   "source": [
    "df[df['id']=='904e1171dc8f7b965563']"
   ]
  },
  {
   "source": [
    "df['actual_time'] = 0\n",
    "for index, row in df.iterrows():\n",
    "    total_child = 0.0\n",
    "    if row['id'] not in children.keys():\n",
    "        df.at[index, 'actual_time'] = row['elapsedTime']\n",
    "        continue\n",
    "    for child in children[row['id']]:\n",
    "        total_child += elapse_time[child]\n",
    "    df.at[index, 'actual_time'] = row['elapsedTime'] - total_child\n",
    "        "
   ],
   "cell_type": "code",
   "metadata": {},
   "execution_count": 20,
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "         callType      startTime  elapsedTime  success               traceId  \\\n",
       "0             OSB  1588543323022        236.0     True  0003b171dc8f7b8e8120   \n",
       "1             CSF  1588543323027        226.0     True  0003b171dc8f7b8e8120   \n",
       "2   RemoteProcess  1588543323027        223.0     True  0003b171dc8f7b8e8120   \n",
       "3       FlyRemote  1588543323030          4.0     True  0003b171dc8f7b8e8120   \n",
       "4             CSF  1588543323036         69.0     True  0003b171dc8f7b8e8120   \n",
       "5   RemoteProcess  1588543323039         65.0     True  0003b171dc8f7b8e8120   \n",
       "6            JDBC  1588543323093          2.0     True  0003b171dc8f7b8e8120   \n",
       "7           LOCAL  1588543323093          6.0     True  0003b171dc8f7b8e8120   \n",
       "8            JDBC  1588543323097          2.0     True  0003b171dc8f7b8e8120   \n",
       "9             CSF  1588543323108         28.0     True  0003b171dc8f7b8e8120   \n",
       "10  RemoteProcess  1588543323110         25.0     True  0003b171dc8f7b8e8120   \n",
       "11           JDBC  1588543323118          2.0     True  0003b171dc8f7b8e8120   \n",
       "12          LOCAL  1588543323118          7.0     True  0003b171dc8f7b8e8120   \n",
       "13           JDBC  1588543323122          3.0     True  0003b171dc8f7b8e8120   \n",
       "14          LOCAL  1588543323126          4.0     True  0003b171dc8f7b8e8120   \n",
       "15           JDBC  1588543323128          2.0     True  0003b171dc8f7b8e8120   \n",
       "16            CSF  1588543323139         22.0     True  0003b171dc8f7b8e8120   \n",
       "17  RemoteProcess  1588543323141         19.0     True  0003b171dc8f7b8e8120   \n",
       "18           JDBC  1588543323144          2.0     True  0003b171dc8f7b8e8120   \n",
       "19          LOCAL  1588543323144          7.0     True  0003b171dc8f7b8e8120   \n",
       "20           JDBC  1588543323148          2.0     True  0003b171dc8f7b8e8120   \n",
       "21          LOCAL  1588543323152          3.0     True  0003b171dc8f7b8e8120   \n",
       "22           JDBC  1588543323153          2.0     True  0003b171dc8f7b8e8120   \n",
       "23            CSF  1588543323163         24.0     True  0003b171dc8f7b8e8120   \n",
       "24  RemoteProcess  1588543323166         20.0     True  0003b171dc8f7b8e8120   \n",
       "25           JDBC  1588543323173          2.0     True  0003b171dc8f7b8e8120   \n",
       "26          LOCAL  1588543323173          7.0     True  0003b171dc8f7b8e8120   \n",
       "27           JDBC  1588543323178          2.0     True  0003b171dc8f7b8e8120   \n",
       "28           JDBC  1588543323188          1.0     True  0003b171dc8f7b8e8120   \n",
       "29          LOCAL  1588543323188          2.0     True  0003b171dc8f7b8e8120   \n",
       "30           JDBC  1588543323190          0.0     True  0003b171dc8f7b8e8120   \n",
       "31          LOCAL  1588543323190          3.0     True  0003b171dc8f7b8e8120   \n",
       "32           JDBC  1588543323192          1.0     True  0003b171dc8f7b8e8120   \n",
       "33          LOCAL  1588543323193          3.0     True  0003b171dc8f7b8e8120   \n",
       "34           JDBC  1588543323195          0.0     True  0003b171dc8f7b8e8120   \n",
       "35          LOCAL  1588543323196          2.0     True  0003b171dc8f7b8e8120   \n",
       "36           JDBC  1588543323197          0.0     True  0003b171dc8f7b8e8120   \n",
       "37          LOCAL  1588543323198          2.0     True  0003b171dc8f7b8e8120   \n",
       "38           JDBC  1588543323199          1.0     True  0003b171dc8f7b8e8120   \n",
       "39          LOCAL  1588543323200          2.0     True  0003b171dc8f7b8e8120   \n",
       "40           JDBC  1588543323201          1.0     True  0003b171dc8f7b8e8120   \n",
       "41          LOCAL  1588543323202          2.0     True  0003b171dc8f7b8e8120   \n",
       "42           JDBC  1588543323203          1.0     True  0003b171dc8f7b8e8120   \n",
       "43          LOCAL  1588543323204          2.0     True  0003b171dc8f7b8e8120   \n",
       "44           JDBC  1588543323205          0.0     True  0003b171dc8f7b8e8120   \n",
       "45          LOCAL  1588543323206          1.0     True  0003b171dc8f7b8e8120   \n",
       "46           JDBC  1588543323207          0.0     True  0003b171dc8f7b8e8120   \n",
       "47          LOCAL  1588543323207          2.0     True  0003b171dc8f7b8e8120   \n",
       "48           JDBC  1588543323208          0.0     True  0003b171dc8f7b8e8120   \n",
       "49          LOCAL  1588543323209          1.0     True  0003b171dc8f7b8e8120   \n",
       "50           JDBC  1588543323210          0.0     True  0003b171dc8f7b8e8120   \n",
       "51          LOCAL  1588543323210          2.0     True  0003b171dc8f7b8e8120   \n",
       "52           JDBC  1588543323211          0.0     True  0003b171dc8f7b8e8120   \n",
       "53          LOCAL  1588543323212          1.0     True  0003b171dc8f7b8e8120   \n",
       "54           JDBC  1588543323213          0.0     True  0003b171dc8f7b8e8120   \n",
       "55           JDBC  1588543323214          2.0     True  0003b171dc8f7b8e8120   \n",
       "56          LOCAL  1588543323214         28.0     True  0003b171dc8f7b8e8120   \n",
       "57           JDBC  1588543323239          3.0     True  0003b171dc8f7b8e8120   \n",
       "\n",
       "                      id                   pid     cmdb_id       serviceName  \\\n",
       "0   dea5d171dc8f7b8e8121                  None      os_021           osb_001   \n",
       "1   f1be6171dc8f7b938125  dea5d171dc8f7b8e8121      os_021           csf_001   \n",
       "2   04aec171dc8f7b935561  f1be6171dc8f7b938125  docker_003           csf_001   \n",
       "3   904e1171dc8f7b965563  04aec171dc8f7b935561  docker_003    fly_remote_001   \n",
       "4   b40a2171dc8f7b9c5565  04aec171dc8f7b935561  docker_003           csf_002   \n",
       "5   26db7171dc8f7b9f5058  b40a2171dc8f7b9c5565  docker_006           csf_002   \n",
       "6   f0c8e171dc8f7bd55075  aec14171dc8f7bd55072  docker_006            db_003   \n",
       "7   aec14171dc8f7bd55072  26db7171dc8f7b9f5058  docker_006  local_method_011   \n",
       "8   e73ac171dc8f7bd95083  aec14171dc8f7bd55072  docker_006            db_003   \n",
       "9   f1e41171dc8f7be35567  04aec171dc8f7b935561  docker_003           csf_003   \n",
       "10  08790171dc8f7be65090  f1e41171dc8f7be35567  docker_006           csf_003   \n",
       "11  b9b80171dc8f7bee5104  545ba171dc8f7bee5101  docker_006            db_003   \n",
       "12  545ba171dc8f7bee5101  08790171dc8f7be65090  docker_006  local_method_013   \n",
       "13  9ffc2171dc8f7bf25107  545ba171dc8f7bee5101  docker_006            db_003   \n",
       "14  ee408171dc8f7bf65112  08790171dc8f7be65090  docker_006  local_method_014   \n",
       "15  93b09171dc8f7bf85117  ee408171dc8f7bf65112  docker_006            db_003   \n",
       "16  576ac171dc8f7c025569  04aec171dc8f7b935561  docker_003           csf_004   \n",
       "17  60a3a171dc8f7c055126  576ac171dc8f7c025569  docker_006           csf_004   \n",
       "18  7fabb171dc8f7c085135  c25d3171dc8f7c085132  docker_006            db_003   \n",
       "19  c25d3171dc8f7c085132  60a3a171dc8f7c055126  docker_006  local_method_015   \n",
       "20  f3530171dc8f7c0c5145  c25d3171dc8f7c085132  docker_006            db_003   \n",
       "21  4e082171dc8f7c105150  60a3a171dc8f7c055126  docker_006  local_method_016   \n",
       "22  3dfd8171dc8f7c115153  4e082171dc8f7c105150  docker_006            db_003   \n",
       "23  1d4cb171dc8f7c1b5571  04aec171dc8f7b935561  docker_003           csf_005   \n",
       "24  374bb171dc8f7c1e5160  1d4cb171dc8f7c1b5571  docker_006           csf_005   \n",
       "25  b731b171dc8f7c255167  a510c171dc8f7c255164  docker_006            db_003   \n",
       "26  a510c171dc8f7c255164  374bb171dc8f7c1e5160  docker_006  local_method_017   \n",
       "27  7d568171dc8f7c2a5178  a510c171dc8f7c255164  docker_006            db_003   \n",
       "28  aa8ef171dc8f7c345576  398fa171dc8f7c345573  docker_003            db_009   \n",
       "29  398fa171dc8f7c345573  04aec171dc8f7b935561  docker_003  local_method_001   \n",
       "30  cdd4c171dc8f7c365579  398fa171dc8f7c345573  docker_003            db_009   \n",
       "31  7f978171dc8f7c365581  04aec171dc8f7b935561  docker_003  local_method_002   \n",
       "32  275fe171dc8f7c385584  7f978171dc8f7c365581  docker_003            db_009   \n",
       "33  595d1171dc8f7c395586  04aec171dc8f7b935561  docker_003  local_method_002   \n",
       "34  3fd9c171dc8f7c3b5589  595d1171dc8f7c395586  docker_003            db_009   \n",
       "35  b59f1171dc8f7c3c5591  04aec171dc8f7b935561  docker_003  local_method_003   \n",
       "36  347a3171dc8f7c3d5594  b59f1171dc8f7c3c5591  docker_003            db_009   \n",
       "37  3e028171dc8f7c3e5596  04aec171dc8f7b935561  docker_003  local_method_004   \n",
       "38  131b2171dc8f7c3f5599  3e028171dc8f7c3e5596  docker_003            db_009   \n",
       "39  f600e171dc8f7c405601  04aec171dc8f7b935561  docker_003  local_method_004   \n",
       "40  b82c8171dc8f7c415604  f600e171dc8f7c405601  docker_003            db_009   \n",
       "41  c9994171dc8f7c425606  04aec171dc8f7b935561  docker_003  local_method_004   \n",
       "42  a880d171dc8f7c435609  c9994171dc8f7c425606  docker_003            db_009   \n",
       "43  02ff7171dc8f7c445611  04aec171dc8f7b935561  docker_003  local_method_004   \n",
       "44  98cc5171dc8f7c455614  02ff7171dc8f7c445611  docker_003            db_009   \n",
       "45  78287171dc8f7c465616  04aec171dc8f7b935561  docker_003  local_method_005   \n",
       "46  beb89171dc8f7c475619  78287171dc8f7c465616  docker_003            db_009   \n",
       "47  6c2e3171dc8f7c475621  04aec171dc8f7b935561  docker_003  local_method_006   \n",
       "48  3a2bf171dc8f7c485624  6c2e3171dc8f7c475621  docker_003            db_009   \n",
       "49  1f403171dc8f7c495626  04aec171dc8f7b935561  docker_003  local_method_007   \n",
       "50  feb91171dc8f7c4a5629  1f403171dc8f7c495626  docker_003            db_009   \n",
       "51  17908171dc8f7c4a5631  04aec171dc8f7b935561  docker_003  local_method_006   \n",
       "52  3a339171dc8f7c4b5634  17908171dc8f7c4a5631  docker_003            db_009   \n",
       "53  fe4ca171dc8f7c4c5636  04aec171dc8f7b935561  docker_003  local_method_009   \n",
       "54  40603171dc8f7c4d5639  fe4ca171dc8f7c4c5636  docker_003            db_009   \n",
       "55  222db171dc8f7c4e5644  36f3c171dc8f7c4e5641  docker_003            db_007   \n",
       "56  36f3c171dc8f7c4e5641  04aec171dc8f7b935561  docker_003  local_method_010   \n",
       "57  728d4171dc8f7c675647  36f3c171dc8f7c4e5641  docker_003            db_007   \n",
       "\n",
       "    dsName  actual_time  \n",
       "0      NaN           10  \n",
       "1      NaN            3  \n",
       "2      NaN           23  \n",
       "3      NaN            4  \n",
       "4      NaN            4  \n",
       "5      NaN           59  \n",
       "6   db_003            2  \n",
       "7   db_003            2  \n",
       "8   db_003            2  \n",
       "9      NaN            3  \n",
       "10     NaN           14  \n",
       "11  db_003            2  \n",
       "12  db_003            2  \n",
       "13  db_003            3  \n",
       "14  db_003            2  \n",
       "15  db_003            2  \n",
       "16     NaN            3  \n",
       "17     NaN            9  \n",
       "18  db_003            2  \n",
       "19  db_003            3  \n",
       "20  db_003            2  \n",
       "21  db_003            1  \n",
       "22  db_003            2  \n",
       "23     NaN            4  \n",
       "24     NaN           13  \n",
       "25  db_003            2  \n",
       "26  db_003            3  \n",
       "27  db_003            2  \n",
       "28  db_009            1  \n",
       "29  db_009            1  \n",
       "30  db_009            0  \n",
       "31  db_009            2  \n",
       "32  db_009            1  \n",
       "33  db_009            3  \n",
       "34  db_009            0  \n",
       "35  db_009            2  \n",
       "36  db_009            0  \n",
       "37  db_009            1  \n",
       "38  db_009            1  \n",
       "39  db_009            1  \n",
       "40  db_009            1  \n",
       "41  db_009            1  \n",
       "42  db_009            1  \n",
       "43  db_009            2  \n",
       "44  db_009            0  \n",
       "45  db_009            1  \n",
       "46  db_009            0  \n",
       "47  db_009            2  \n",
       "48  db_009            0  \n",
       "49  db_009            1  \n",
       "50  db_009            0  \n",
       "51  db_009            2  \n",
       "52  db_009            0  \n",
       "53  db_009            1  \n",
       "54  db_009            0  \n",
       "55  db_007            2  \n",
       "56  db_007           23  \n",
       "57  db_007            3  "
      ],
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>callType</th>\n      <th>startTime</th>\n      <th>elapsedTime</th>\n      <th>success</th>\n      <th>traceId</th>\n      <th>id</th>\n      <th>pid</th>\n      <th>cmdb_id</th>\n      <th>serviceName</th>\n      <th>dsName</th>\n      <th>actual_time</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>OSB</td>\n      <td>1588543323022</td>\n      <td>236.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>dea5d171dc8f7b8e8121</td>\n      <td>None</td>\n      <td>os_021</td>\n      <td>osb_001</td>\n      <td>NaN</td>\n      <td>10</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>CSF</td>\n      <td>1588543323027</td>\n      <td>226.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>f1be6171dc8f7b938125</td>\n      <td>dea5d171dc8f7b8e8121</td>\n      <td>os_021</td>\n      <td>csf_001</td>\n      <td>NaN</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>RemoteProcess</td>\n      <td>1588543323027</td>\n      <td>223.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>f1be6171dc8f7b938125</td>\n      <td>docker_003</td>\n      <td>csf_001</td>\n      <td>NaN</td>\n      <td>23</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>FlyRemote</td>\n      <td>1588543323030</td>\n      <td>4.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>904e1171dc8f7b965563</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>fly_remote_001</td>\n      <td>NaN</td>\n      <td>4</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>CSF</td>\n      <td>1588543323036</td>\n      <td>69.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>b40a2171dc8f7b9c5565</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>csf_002</td>\n      <td>NaN</td>\n      <td>4</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>RemoteProcess</td>\n      <td>1588543323039</td>\n      <td>65.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>26db7171dc8f7b9f5058</td>\n      <td>b40a2171dc8f7b9c5565</td>\n      <td>docker_006</td>\n      <td>csf_002</td>\n      <td>NaN</td>\n      <td>59</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>JDBC</td>\n      <td>1588543323093</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>f0c8e171dc8f7bd55075</td>\n      <td>aec14171dc8f7bd55072</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>LOCAL</td>\n      <td>1588543323093</td>\n      <td>6.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>aec14171dc8f7bd55072</td>\n      <td>26db7171dc8f7b9f5058</td>\n      <td>docker_006</td>\n      <td>local_method_011</td>\n      <td>db_003</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>JDBC</td>\n      <td>1588543323097</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>e73ac171dc8f7bd95083</td>\n      <td>aec14171dc8f7bd55072</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>CSF</td>\n      <td>1588543323108</td>\n      <td>28.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>f1e41171dc8f7be35567</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>csf_003</td>\n      <td>NaN</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>RemoteProcess</td>\n      <td>1588543323110</td>\n      <td>25.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>08790171dc8f7be65090</td>\n      <td>f1e41171dc8f7be35567</td>\n      <td>docker_006</td>\n      <td>csf_003</td>\n      <td>NaN</td>\n      <td>14</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>JDBC</td>\n      <td>1588543323118</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>b9b80171dc8f7bee5104</td>\n      <td>545ba171dc8f7bee5101</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>LOCAL</td>\n      <td>1588543323118</td>\n      <td>7.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>545ba171dc8f7bee5101</td>\n      <td>08790171dc8f7be65090</td>\n      <td>docker_006</td>\n      <td>local_method_013</td>\n      <td>db_003</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>JDBC</td>\n      <td>1588543323122</td>\n      <td>3.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>9ffc2171dc8f7bf25107</td>\n      <td>545ba171dc8f7bee5101</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>14</th>\n      <td>LOCAL</td>\n      <td>1588543323126</td>\n      <td>4.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>ee408171dc8f7bf65112</td>\n      <td>08790171dc8f7be65090</td>\n      <td>docker_006</td>\n      <td>local_method_014</td>\n      <td>db_003</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>15</th>\n      <td>JDBC</td>\n      <td>1588543323128</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>93b09171dc8f7bf85117</td>\n      <td>ee408171dc8f7bf65112</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>16</th>\n      <td>CSF</td>\n      <td>1588543323139</td>\n      <td>22.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>576ac171dc8f7c025569</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>csf_004</td>\n      <td>NaN</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>17</th>\n      <td>RemoteProcess</td>\n      <td>1588543323141</td>\n      <td>19.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>60a3a171dc8f7c055126</td>\n      <td>576ac171dc8f7c025569</td>\n      <td>docker_006</td>\n      <td>csf_004</td>\n      <td>NaN</td>\n      <td>9</td>\n    </tr>\n    <tr>\n      <th>18</th>\n      <td>JDBC</td>\n      <td>1588543323144</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>7fabb171dc8f7c085135</td>\n      <td>c25d3171dc8f7c085132</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>19</th>\n      <td>LOCAL</td>\n      <td>1588543323144</td>\n      <td>7.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>c25d3171dc8f7c085132</td>\n      <td>60a3a171dc8f7c055126</td>\n      <td>docker_006</td>\n      <td>local_method_015</td>\n      <td>db_003</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>20</th>\n      <td>JDBC</td>\n      <td>1588543323148</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>f3530171dc8f7c0c5145</td>\n      <td>c25d3171dc8f7c085132</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>21</th>\n      <td>LOCAL</td>\n      <td>1588543323152</td>\n      <td>3.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>4e082171dc8f7c105150</td>\n      <td>60a3a171dc8f7c055126</td>\n      <td>docker_006</td>\n      <td>local_method_016</td>\n      <td>db_003</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>22</th>\n      <td>JDBC</td>\n      <td>1588543323153</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>3dfd8171dc8f7c115153</td>\n      <td>4e082171dc8f7c105150</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>23</th>\n      <td>CSF</td>\n      <td>1588543323163</td>\n      <td>24.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>1d4cb171dc8f7c1b5571</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>csf_005</td>\n      <td>NaN</td>\n      <td>4</td>\n    </tr>\n    <tr>\n      <th>24</th>\n      <td>RemoteProcess</td>\n      <td>1588543323166</td>\n      <td>20.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>374bb171dc8f7c1e5160</td>\n      <td>1d4cb171dc8f7c1b5571</td>\n      <td>docker_006</td>\n      <td>csf_005</td>\n      <td>NaN</td>\n      <td>13</td>\n    </tr>\n    <tr>\n      <th>25</th>\n      <td>JDBC</td>\n      <td>1588543323173</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>b731b171dc8f7c255167</td>\n      <td>a510c171dc8f7c255164</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>26</th>\n      <td>LOCAL</td>\n      <td>1588543323173</td>\n      <td>7.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>a510c171dc8f7c255164</td>\n      <td>374bb171dc8f7c1e5160</td>\n      <td>docker_006</td>\n      <td>local_method_017</td>\n      <td>db_003</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>27</th>\n      <td>JDBC</td>\n      <td>1588543323178</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>7d568171dc8f7c2a5178</td>\n      <td>a510c171dc8f7c255164</td>\n      <td>docker_006</td>\n      <td>db_003</td>\n      <td>db_003</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>28</th>\n      <td>JDBC</td>\n      <td>1588543323188</td>\n      <td>1.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>aa8ef171dc8f7c345576</td>\n      <td>398fa171dc8f7c345573</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>29</th>\n      <td>LOCAL</td>\n      <td>1588543323188</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>398fa171dc8f7c345573</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_001</td>\n      <td>db_009</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>30</th>\n      <td>JDBC</td>\n      <td>1588543323190</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>cdd4c171dc8f7c365579</td>\n      <td>398fa171dc8f7c345573</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>31</th>\n      <td>LOCAL</td>\n      <td>1588543323190</td>\n      <td>3.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>7f978171dc8f7c365581</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_002</td>\n      <td>db_009</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>32</th>\n      <td>JDBC</td>\n      <td>1588543323192</td>\n      <td>1.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>275fe171dc8f7c385584</td>\n      <td>7f978171dc8f7c365581</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>33</th>\n      <td>LOCAL</td>\n      <td>1588543323193</td>\n      <td>3.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>595d1171dc8f7c395586</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_002</td>\n      <td>db_009</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>34</th>\n      <td>JDBC</td>\n      <td>1588543323195</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>3fd9c171dc8f7c3b5589</td>\n      <td>595d1171dc8f7c395586</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>35</th>\n      <td>LOCAL</td>\n      <td>1588543323196</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>b59f1171dc8f7c3c5591</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_003</td>\n      <td>db_009</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>36</th>\n      <td>JDBC</td>\n      <td>1588543323197</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>347a3171dc8f7c3d5594</td>\n      <td>b59f1171dc8f7c3c5591</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>37</th>\n      <td>LOCAL</td>\n      <td>1588543323198</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>3e028171dc8f7c3e5596</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_004</td>\n      <td>db_009</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>38</th>\n      <td>JDBC</td>\n      <td>1588543323199</td>\n      <td>1.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>131b2171dc8f7c3f5599</td>\n      <td>3e028171dc8f7c3e5596</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>39</th>\n      <td>LOCAL</td>\n      <td>1588543323200</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>f600e171dc8f7c405601</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_004</td>\n      <td>db_009</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>40</th>\n      <td>JDBC</td>\n      <td>1588543323201</td>\n      <td>1.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>b82c8171dc8f7c415604</td>\n      <td>f600e171dc8f7c405601</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>41</th>\n      <td>LOCAL</td>\n      <td>1588543323202</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>c9994171dc8f7c425606</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_004</td>\n      <td>db_009</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>42</th>\n      <td>JDBC</td>\n      <td>1588543323203</td>\n      <td>1.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>a880d171dc8f7c435609</td>\n      <td>c9994171dc8f7c425606</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>43</th>\n      <td>LOCAL</td>\n      <td>1588543323204</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>02ff7171dc8f7c445611</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_004</td>\n      <td>db_009</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>44</th>\n      <td>JDBC</td>\n      <td>1588543323205</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>98cc5171dc8f7c455614</td>\n      <td>02ff7171dc8f7c445611</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>45</th>\n      <td>LOCAL</td>\n      <td>1588543323206</td>\n      <td>1.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>78287171dc8f7c465616</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_005</td>\n      <td>db_009</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>46</th>\n      <td>JDBC</td>\n      <td>1588543323207</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>beb89171dc8f7c475619</td>\n      <td>78287171dc8f7c465616</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>47</th>\n      <td>LOCAL</td>\n      <td>1588543323207</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>6c2e3171dc8f7c475621</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_006</td>\n      <td>db_009</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>48</th>\n      <td>JDBC</td>\n      <td>1588543323208</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>3a2bf171dc8f7c485624</td>\n      <td>6c2e3171dc8f7c475621</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>49</th>\n      <td>LOCAL</td>\n      <td>1588543323209</td>\n      <td>1.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>1f403171dc8f7c495626</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_007</td>\n      <td>db_009</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>50</th>\n      <td>JDBC</td>\n      <td>1588543323210</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>feb91171dc8f7c4a5629</td>\n      <td>1f403171dc8f7c495626</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>51</th>\n      <td>LOCAL</td>\n      <td>1588543323210</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>17908171dc8f7c4a5631</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_006</td>\n      <td>db_009</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>52</th>\n      <td>JDBC</td>\n      <td>1588543323211</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>3a339171dc8f7c4b5634</td>\n      <td>17908171dc8f7c4a5631</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>53</th>\n      <td>LOCAL</td>\n      <td>1588543323212</td>\n      <td>1.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>fe4ca171dc8f7c4c5636</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_009</td>\n      <td>db_009</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>54</th>\n      <td>JDBC</td>\n      <td>1588543323213</td>\n      <td>0.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>40603171dc8f7c4d5639</td>\n      <td>fe4ca171dc8f7c4c5636</td>\n      <td>docker_003</td>\n      <td>db_009</td>\n      <td>db_009</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>55</th>\n      <td>JDBC</td>\n      <td>1588543323214</td>\n      <td>2.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>222db171dc8f7c4e5644</td>\n      <td>36f3c171dc8f7c4e5641</td>\n      <td>docker_003</td>\n      <td>db_007</td>\n      <td>db_007</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>56</th>\n      <td>LOCAL</td>\n      <td>1588543323214</td>\n      <td>28.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>36f3c171dc8f7c4e5641</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>local_method_010</td>\n      <td>db_007</td>\n      <td>23</td>\n    </tr>\n    <tr>\n      <th>57</th>\n      <td>JDBC</td>\n      <td>1588543323239</td>\n      <td>3.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>728d4171dc8f7c675647</td>\n      <td>36f3c171dc8f7c4e5641</td>\n      <td>docker_003</td>\n      <td>db_007</td>\n      <td>db_007</td>\n      <td>3</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 21
    }
   ],
   "source": [
    "df.head(58)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "metadata": {},
   "outputs": [],
   "source": [
    "df['host_service'] = df['cmdb_id'] +':'+ df['serviceName']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "        callType      startTime  elapsedTime  success               traceId  \\\n",
       "0            OSB  1588543323022        236.0     True  0003b171dc8f7b8e8120   \n",
       "1            CSF  1588543323027        226.0     True  0003b171dc8f7b8e8120   \n",
       "2  RemoteProcess  1588543323027        223.0     True  0003b171dc8f7b8e8120   \n",
       "3      FlyRemote  1588543323030          4.0     True  0003b171dc8f7b8e8120   \n",
       "4            CSF  1588543323036         69.0     True  0003b171dc8f7b8e8120   \n",
       "\n",
       "                     id                   pid     cmdb_id     serviceName  \\\n",
       "0  dea5d171dc8f7b8e8121                  None      os_021         osb_001   \n",
       "1  f1be6171dc8f7b938125  dea5d171dc8f7b8e8121      os_021         csf_001   \n",
       "2  04aec171dc8f7b935561  f1be6171dc8f7b938125  docker_003         csf_001   \n",
       "3  904e1171dc8f7b965563  04aec171dc8f7b935561  docker_003  fly_remote_001   \n",
       "4  b40a2171dc8f7b9c5565  04aec171dc8f7b935561  docker_003         csf_002   \n",
       "\n",
       "  dsName  actual_time               host_service  \n",
       "0    NaN           10             os_021:osb_001  \n",
       "1    NaN            3             os_021:csf_001  \n",
       "2    NaN           23         docker_003:csf_001  \n",
       "3    NaN            4  docker_003:fly_remote_001  \n",
       "4    NaN            4         docker_003:csf_002  "
      ],
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>callType</th>\n      <th>startTime</th>\n      <th>elapsedTime</th>\n      <th>success</th>\n      <th>traceId</th>\n      <th>id</th>\n      <th>pid</th>\n      <th>cmdb_id</th>\n      <th>serviceName</th>\n      <th>dsName</th>\n      <th>actual_time</th>\n      <th>host_service</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>OSB</td>\n      <td>1588543323022</td>\n      <td>236.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>dea5d171dc8f7b8e8121</td>\n      <td>None</td>\n      <td>os_021</td>\n      <td>osb_001</td>\n      <td>NaN</td>\n      <td>10</td>\n      <td>os_021:osb_001</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>CSF</td>\n      <td>1588543323027</td>\n      <td>226.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>f1be6171dc8f7b938125</td>\n      <td>dea5d171dc8f7b8e8121</td>\n      <td>os_021</td>\n      <td>csf_001</td>\n      <td>NaN</td>\n      <td>3</td>\n      <td>os_021:csf_001</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>RemoteProcess</td>\n      <td>1588543323027</td>\n      <td>223.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>f1be6171dc8f7b938125</td>\n      <td>docker_003</td>\n      <td>csf_001</td>\n      <td>NaN</td>\n      <td>23</td>\n      <td>docker_003:csf_001</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>FlyRemote</td>\n      <td>1588543323030</td>\n      <td>4.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>904e1171dc8f7b965563</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>fly_remote_001</td>\n      <td>NaN</td>\n      <td>4</td>\n      <td>docker_003:fly_remote_001</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>CSF</td>\n      <td>1588543323036</td>\n      <td>69.0</td>\n      <td>True</td>\n      <td>0003b171dc8f7b8e8120</td>\n      <td>b40a2171dc8f7b9c5565</td>\n      <td>04aec171dc8f7b935561</td>\n      <td>docker_003</td>\n      <td>csf_002</td>\n      <td>NaN</td>\n      <td>4</td>\n      <td>docker_003:csf_002</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 106
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "metadata": {},
   "outputs": [],
   "source": [
    "data_dict = dict()\n",
    "for service in df.host_service.unique():\n",
    "    data_array = df[df['host_service']==service]['actual_time']\n",
    "    data_dict[service] = data_array"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "local_method_010\n"
     ]
    }
   ],
   "source": [
    "print(service)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "752        3\n",
       "984        2\n",
       "1159       1\n",
       "1217       2\n",
       "1449       3\n",
       "          ..\n",
       "566018     4\n",
       "566076     1\n",
       "566308     1\n",
       "566366     1\n",
       "566424    96\n",
       "Name: actual_time, Length: 2448, dtype: int64"
      ]
     },
     "metadata": {},
     "execution_count": 69
    }
   ],
   "source": [
    "data_dict[service]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.cluster import Birch\n",
    "from sklearn import preprocessing\n",
    "import numpy as np\n",
    "\n",
    "def birch(latency):\n",
    "    latency = latency.rolling(window=3, min_periods=1).mean()\n",
    "    x = np.array(latency)\n",
    "    x = np.where(np.isnan(x), 0, x)\n",
    "    normalized_x = preprocessing.normalize([x])\n",
    "\n",
    "    X = normalized_x.reshape(-1,1)\n",
    "\n",
    "    threshold = 0.03\n",
    "\n",
    "    brc = Birch(branching_factor=50, n_clusters=None, threshold=threshold, compute_labels=True)\n",
    "    brc.fit(X)\n",
    "    brc.predict(X)\n",
    "    labels = brc.labels_\n",
    "    n_clusters = np.unique(labels).size\n",
    "    if n_clusters > 1:\n",
    "        print(n_clusters)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {},
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "os_021_osb_001\n",
      "os_021_csf_001\n",
      "docker_003_csf_001\n",
      "docker_003_fly_remote_001\n",
      "docker_003_csf_002\n",
      "docker_006_csf_002\n",
      "docker_006_db_003\n",
      "docker_006_local_method_011\n",
      "docker_003_csf_003\n",
      "docker_006_csf_003\n",
      "docker_006_local_method_013\n",
      "docker_006_local_method_014\n",
      "docker_003_csf_004\n",
      "docker_006_csf_004\n",
      "docker_006_local_method_015\n",
      "docker_006_local_method_016\n",
      "docker_003_csf_005\n",
      "docker_006_csf_005\n",
      "docker_006_local_method_017\n",
      "docker_003_db_009\n",
      "docker_003_local_method_001\n",
      "docker_003_local_method_002\n",
      "docker_003_local_method_003\n",
      "docker_003_local_method_004\n",
      "docker_003_local_method_005\n",
      "docker_003_local_method_006\n",
      "docker_003_local_method_007\n",
      "docker_003_local_method_009\n",
      "docker_003_db_007\n",
      "docker_003_local_method_010\n",
      "os_022_osb_001\n",
      "os_022_csf_001\n",
      "docker_001_csf_001\n",
      "docker_001_fly_remote_001\n",
      "docker_001_csf_002\n",
      "docker_007_csf_002\n",
      "docker_007_db_003\n",
      "docker_007_local_method_011\n",
      "docker_001_csf_003\n",
      "docker_007_csf_003\n",
      "docker_007_local_method_013\n",
      "docker_007_local_method_014\n",
      "docker_001_csf_004\n",
      "docker_007_csf_004\n",
      "docker_007_local_method_015\n",
      "docker_007_local_method_016\n",
      "docker_001_csf_005\n",
      "docker_007_csf_005\n",
      "docker_007_local_method_017\n",
      "docker_001_db_009\n",
      "docker_001_local_method_001\n",
      "docker_001_local_method_002\n",
      "docker_001_local_method_003\n",
      "docker_001_local_method_004\n",
      "docker_001_local_method_005\n",
      "docker_001_local_method_006\n",
      "2\n",
      "docker_001_local_method_007\n",
      "docker_001_local_method_009\n",
      "docker_001_db_007\n",
      "docker_001_local_method_010\n",
      "docker_004_csf_001\n",
      "docker_004_fly_remote_001\n",
      "docker_004_csf_002\n",
      "docker_004_csf_003\n",
      "docker_004_csf_004\n",
      "2\n",
      "docker_004_csf_005\n",
      "docker_004_local_method_001\n",
      "docker_004_db_009\n",
      "docker_004_local_method_002\n",
      "docker_004_local_method_003\n",
      "docker_004_local_method_004\n",
      "2\n",
      "docker_004_local_method_005\n",
      "docker_004_local_method_006\n",
      "docker_004_local_method_007\n",
      "docker_004_local_method_009\n",
      "docker_004_db_007\n",
      "docker_004_local_method_010\n",
      "docker_008_csf_002\n",
      "docker_008_db_003\n",
      "docker_008_local_method_011\n",
      "docker_008_csf_005\n",
      "docker_008_local_method_017\n",
      "docker_008_csf_003\n",
      "docker_008_local_method_013\n",
      "docker_008_local_method_014\n",
      "docker_008_csf_004\n",
      "docker_008_local_method_015\n",
      "docker_008_local_method_016\n",
      "docker_002_csf_001\n",
      "2\n",
      "docker_002_fly_remote_001\n",
      "docker_002_csf_002\n",
      "2\n",
      "docker_002_csf_003\n",
      "docker_002_csf_004\n",
      "docker_002_csf_005\n",
      "2\n",
      "docker_002_local_method_001\n",
      "docker_002_db_009\n",
      "docker_002_local_method_002\n",
      "3\n",
      "docker_002_local_method_003\n",
      "docker_002_local_method_004\n",
      "docker_002_local_method_005\n",
      "docker_002_local_method_006\n",
      "docker_002_local_method_007\n",
      "3\n",
      "docker_002_local_method_009\n",
      "docker_002_db_007\n",
      "3\n",
      "docker_002_local_method_010\n"
     ]
    }
   ],
   "source": [
    "for service in data_dict:\n",
    "    birch(data_dict[service])\n",
    "    print(service)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [],
   "source": [
    "path = r'D:\\THU Studies\\Advance Network Management\\Project\\training_data\\2020_05_04\\host\\dcos_docker.csv'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [],
   "source": [
    "doc_df = pd.read_csv(path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [],
   "source": [
    "d2_df = doc_df[doc_df['cmdb_id']=='docker_002']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [],
   "source": [
    "d2_df = d2_df[(d2_df['timestamp']>=1588542600000) & (d2_df['timestamp']<= 1588543740000)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "                itemid                       name     bomc_id      timestamp  \\\n",
       "23678  999999996381368   container_thread_running  ZJ-004-062  1588542631000   \n",
       "23679  999999996353966  container_thread_used_pct  ZJ-004-061  1588542631000   \n",
       "23680  999999996381380         container_cpu_used  ZJ-004-059  1588542631000   \n",
       "23681  999999996381367     container_thread_total  ZJ-004-064  1588542631000   \n",
       "23682  999999996381376         container_mem_used  ZJ-004-060  1588542631000   \n",
       "\n",
       "       value     cmdb_id  \n",
       "23678    0.0  docker_002  \n",
       "23679    0.0  docker_002  \n",
       "23680   80.0  docker_002  \n",
       "23681    0.0  docker_002  \n",
       "23682   74.0  docker_002  "
      ],
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>itemid</th>\n      <th>name</th>\n      <th>bomc_id</th>\n      <th>timestamp</th>\n      <th>value</th>\n      <th>cmdb_id</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>23678</th>\n      <td>999999996381368</td>\n      <td>container_thread_running</td>\n      <td>ZJ-004-062</td>\n      <td>1588542631000</td>\n      <td>0.0</td>\n      <td>docker_002</td>\n    </tr>\n    <tr>\n      <th>23679</th>\n      <td>999999996353966</td>\n      <td>container_thread_used_pct</td>\n      <td>ZJ-004-061</td>\n      <td>1588542631000</td>\n      <td>0.0</td>\n      <td>docker_002</td>\n    </tr>\n    <tr>\n      <th>23680</th>\n      <td>999999996381380</td>\n      <td>container_cpu_used</td>\n      <td>ZJ-004-059</td>\n      <td>1588542631000</td>\n      <td>80.0</td>\n      <td>docker_002</td>\n    </tr>\n    <tr>\n      <th>23681</th>\n      <td>999999996381367</td>\n      <td>container_thread_total</td>\n      <td>ZJ-004-064</td>\n      <td>1588542631000</td>\n      <td>0.0</td>\n      <td>docker_002</td>\n    </tr>\n    <tr>\n      <th>23682</th>\n      <td>999999996381376</td>\n      <td>container_mem_used</td>\n      <td>ZJ-004-060</td>\n      <td>1588542631000</td>\n      <td>74.0</td>\n      <td>docker_002</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 86
    }
   ],
   "source": [
    "d2_df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {},
   "outputs": [],
   "source": [
    "d2_df = d2_df.sort_values(['name','timestamp'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "                     name     bomc_id      timestamp  value     cmdb_id\n23680  container_cpu_used  ZJ-004-059  1588542631000   80.0  docker_002\n23743  container_cpu_used  ZJ-004-059  1588542692000   83.0  docker_002\n23806  container_cpu_used  ZJ-004-059  1588542751000   80.0  docker_002\n23860  container_cpu_used  ZJ-004-059  1588542810000   76.0  docker_002\n23941  container_cpu_used  ZJ-004-059  1588542870000   45.0  docker_002\n23980  container_cpu_used  ZJ-004-059  1588542903000   82.0  docker_002\n24069  container_cpu_used  ZJ-004-059  1588542991000   81.0  docker_002\n24154  container_cpu_used  ZJ-004-059  1588543050000   79.0  docker_002\n24231  container_cpu_used  ZJ-004-059  1588543111000   83.0  docker_002\n24283  container_cpu_used  ZJ-004-059  1588543171000   81.0  docker_002\n24360  container_cpu_used  ZJ-004-059  1588543233000   28.0  docker_002\n24428  container_cpu_used  ZJ-004-059  1588543263000   83.0  docker_002\n24500  container_cpu_used  ZJ-004-059  1588543350000   38.0  docker_002\n24563  container_cpu_used  ZJ-004-059  1588543385000    2.0  docker_002\n24639  container_cpu_used  ZJ-004-059  1588543471000   75.0  docker_002\n24711  container_cpu_used  ZJ-004-059  1588543531000   81.0  docker_002\n24787  container_cpu_used  ZJ-004-059  1588543591000   83.0  docker_002\n24853  container_cpu_used  ZJ-004-059  1588543651000   83.0  docker_002\n                name     bomc_id      timestamp  value     cmdb_id\n23686  container_fgc  ZJ-004-103  1588542631000    0.0  docker_002\n23747  container_fgc  ZJ-004-103  1588542692000    0.0  docker_002\n23810  container_fgc  ZJ-004-103  1588542751000    0.0  docker_002\n23864  container_fgc  ZJ-004-103  1588542810000    0.0  docker_002\n23945  container_fgc  ZJ-004-103  1588542870000    0.0  docker_002\n23985  container_fgc  ZJ-004-103  1588542903000    0.0  docker_002\n24073  container_fgc  ZJ-004-103  1588542991000    0.0  docker_002\n24162  container_fgc  ZJ-004-103  1588543050000    0.0  docker_002\n24235  container_fgc  ZJ-004-103  1588543111000    0.0  docker_002\n24287  container_fgc  ZJ-004-103  1588543171000    0.0  docker_002\n24353  container_fgc  ZJ-004-103  1588543233000    0.0  docker_002\n24432  container_fgc  ZJ-004-103  1588543263000    0.0  docker_002\n24504  container_fgc  ZJ-004-103  1588543350000    0.0  docker_002\n24567  container_fgc  ZJ-004-103  1588543385000    0.0  docker_002\n24644  container_fgc  ZJ-004-103  1588543471000    0.0  docker_002\n24716  container_fgc  ZJ-004-103  1588543531000    0.0  docker_002\n24791  container_fgc  ZJ-004-103  1588543591000    0.0  docker_002\n24859  container_fgc  ZJ-004-103  1588543651000    0.0  docker_002\n                 name     bomc_id      timestamp  value     cmdb_id\n23684  container_fgct  ZJ-004-104  1588542631000    0.0  docker_002\n23746  container_fgct  ZJ-004-104  1588542692000    0.0  docker_002\n23809  container_fgct  ZJ-004-104  1588542751000    0.0  docker_002\n23863  container_fgct  ZJ-004-104  1588542810000    0.0  docker_002\n23944  container_fgct  ZJ-004-104  1588542870000    0.0  docker_002\n23983  container_fgct  ZJ-004-104  1588542903000    0.0  docker_002\n24067  container_fgct  ZJ-004-104  1588542991000    0.0  docker_002\n24152  container_fgct  ZJ-004-104  1588543050000    0.0  docker_002\n24229  container_fgct  ZJ-004-104  1588543111000    0.0  docker_002\n24279  container_fgct  ZJ-004-104  1588543171000    0.0  docker_002\n24355  container_fgct  ZJ-004-104  1588543233000    0.0  docker_002\n24426  container_fgct  ZJ-004-104  1588543263000    0.0  docker_002\n24498  container_fgct  ZJ-004-104  1588543350000    0.0  docker_002\n24561  container_fgct  ZJ-004-104  1588543385000    0.0  docker_002\n24634  container_fgct  ZJ-004-104  1588543471000    0.0  docker_002\n24706  container_fgct  ZJ-004-104  1588543531000    0.0  docker_002\n24790  container_fgct  ZJ-004-104  1588543591000    0.0  docker_002\n24857  container_fgct  ZJ-004-104  1588543651000    0.0  docker_002\n                     name     bomc_id      timestamp  value     cmdb_id\n23682  container_mem_used  ZJ-004-060  1588542631000   74.0  docker_002\n23745  container_mem_used  ZJ-004-060  1588542692000   74.0  docker_002\n23808  container_mem_used  ZJ-004-060  1588542751000   74.0  docker_002\n23862  container_mem_used  ZJ-004-060  1588542810000   74.0  docker_002\n23943  container_mem_used  ZJ-004-060  1588542870000   74.0  docker_002\n23982  container_mem_used  ZJ-004-060  1588542903000   74.0  docker_002\n24070  container_mem_used  ZJ-004-060  1588542991000   74.0  docker_002\n24157  container_mem_used  ZJ-004-060  1588543050000   74.0  docker_002\n24232  container_mem_used  ZJ-004-060  1588543111000   74.0  docker_002\n24284  container_mem_used  ZJ-004-060  1588543171000   74.0  docker_002\n24361  container_mem_used  ZJ-004-060  1588543233000   74.0  docker_002\n24430  container_mem_used  ZJ-004-060  1588543263000   74.0  docker_002\n24502  container_mem_used  ZJ-004-060  1588543350000   74.0  docker_002\n24565  container_mem_used  ZJ-004-060  1588543385000   74.0  docker_002\n24642  container_mem_used  ZJ-004-060  1588543471000   74.0  docker_002\n24714  container_mem_used  ZJ-004-060  1588543531000   74.0  docker_002\n24789  container_mem_used  ZJ-004-060  1588543591000   74.0  docker_002\n24856  container_mem_used  ZJ-004-060  1588543651000   74.0  docker_002\n                         name     bomc_id      timestamp  value     cmdb_id\n23685  container_session_used  ZJ-004-058  1588542631000    0.0  docker_002\n23749  container_session_used  ZJ-004-058  1588542692000    0.0  docker_002\n23812  container_session_used  ZJ-004-058  1588542751000    0.0  docker_002\n23866  container_session_used  ZJ-004-058  1588542810000    0.0  docker_002\n23947  container_session_used  ZJ-004-058  1588542870000    0.0  docker_002\n23992  container_session_used  ZJ-004-058  1588542903000    0.0  docker_002\n24071  container_session_used  ZJ-004-058  1588542991000    0.0  docker_002\n24158  container_session_used  ZJ-004-058  1588543050000    0.0  docker_002\n24233  container_session_used  ZJ-004-058  1588543111000    0.0  docker_002\n24285  container_session_used  ZJ-004-058  1588543171000    0.0  docker_002\n24356  container_session_used  ZJ-004-058  1588543233000    0.0  docker_002\n24433  container_session_used  ZJ-004-058  1588543263000    0.0  docker_002\n24505  container_session_used  ZJ-004-058  1588543350000    0.0  docker_002\n24568  container_session_used  ZJ-004-058  1588543385000    0.0  docker_002\n24649  container_session_used  ZJ-004-058  1588543471000    0.0  docker_002\n24721  container_session_used  ZJ-004-058  1588543531000    0.0  docker_002\n24788  container_session_used  ZJ-004-058  1588543591000    0.0  docker_002\n24855  container_session_used  ZJ-004-058  1588543651000    0.0  docker_002\n                        name     bomc_id      timestamp  value     cmdb_id\n23683  container_thread_idle  ZJ-004-063  1588542631000    0.0  docker_002\n23748  container_thread_idle  ZJ-004-063  1588542692000    0.0  docker_002\n23811  container_thread_idle  ZJ-004-063  1588542751000    0.0  docker_002\n23865  container_thread_idle  ZJ-004-063  1588542810000    0.0  docker_002\n23946  container_thread_idle  ZJ-004-063  1588542870000    0.0  docker_002\n23988  container_thread_idle  ZJ-004-063  1588542903000    0.0  docker_002\n24065  container_thread_idle  ZJ-004-063  1588542991000    0.0  docker_002\n24147  container_thread_idle  ZJ-004-063  1588543050000    0.0  docker_002\n24227  container_thread_idle  ZJ-004-063  1588543111000    0.0  docker_002\n24272  container_thread_idle  ZJ-004-063  1588543171000    0.0  docker_002\n24354  container_thread_idle  ZJ-004-063  1588543233000    0.0  docker_002\n24431  container_thread_idle  ZJ-004-063  1588543263000    0.0  docker_002\n24503  container_thread_idle  ZJ-004-063  1588543350000    0.0  docker_002\n24566  container_thread_idle  ZJ-004-063  1588543385000    0.0  docker_002\n24643  container_thread_idle  ZJ-004-063  1588543471000    0.0  docker_002\n24715  container_thread_idle  ZJ-004-063  1588543531000    0.0  docker_002\n24792  container_thread_idle  ZJ-004-063  1588543591000    0.0  docker_002\n24860  container_thread_idle  ZJ-004-063  1588543651000    0.0  docker_002\n                           name     bomc_id      timestamp  value     cmdb_id\n23678  container_thread_running  ZJ-004-062  1588542631000    0.0  docker_002\n23741  container_thread_running  ZJ-004-062  1588542692000    0.0  docker_002\n23804  container_thread_running  ZJ-004-062  1588542751000    0.0  docker_002\n23858  container_thread_running  ZJ-004-062  1588542810000    0.0  docker_002\n23939  container_thread_running  ZJ-004-062  1588542870000    0.0  docker_002\n23975  container_thread_running  ZJ-004-062  1588542903000    0.0  docker_002\n24066  container_thread_running  ZJ-004-062  1588542991000    0.0  docker_002\n24150  container_thread_running  ZJ-004-062  1588543050000    0.0  docker_002\n24228  container_thread_running  ZJ-004-062  1588543111000    0.0  docker_002\n24276  container_thread_running  ZJ-004-062  1588543171000    0.0  docker_002\n24358  container_thread_running  ZJ-004-062  1588543233000    0.0  docker_002\n24425  container_thread_running  ZJ-004-062  1588543263000    0.0  docker_002\n24497  container_thread_running  ZJ-004-062  1588543350000    0.0  docker_002\n24560  container_thread_running  ZJ-004-062  1588543385000    0.0  docker_002\n24632  container_thread_running  ZJ-004-062  1588543471000    0.0  docker_002\n24704  container_thread_running  ZJ-004-062  1588543531000    0.0  docker_002\n24785  container_thread_running  ZJ-004-062  1588543591000    0.0  docker_002\n24848  container_thread_running  ZJ-004-062  1588543651000    0.0  docker_002\n                         name     bomc_id      timestamp  value     cmdb_id\n23681  container_thread_total  ZJ-004-064  1588542631000    0.0  docker_002\n23744  container_thread_total  ZJ-004-064  1588542692000    0.0  docker_002\n23807  container_thread_total  ZJ-004-064  1588542751000    0.0  docker_002\n23861  container_thread_total  ZJ-004-064  1588542810000    0.0  docker_002\n23942  container_thread_total  ZJ-004-064  1588542870000    0.0  docker_002\n23981  container_thread_total  ZJ-004-064  1588542903000    0.0  docker_002\n24072  container_thread_total  ZJ-004-064  1588542991000    0.0  docker_002\n24160  container_thread_total  ZJ-004-064  1588543050000    0.0  docker_002\n24234  container_thread_total  ZJ-004-064  1588543111000    0.0  docker_002\n24286  container_thread_total  ZJ-004-064  1588543171000    0.0  docker_002\n24357  container_thread_total  ZJ-004-064  1588543233000    0.0  docker_002\n24429  container_thread_total  ZJ-004-064  1588543263000    0.0  docker_002\n24501  container_thread_total  ZJ-004-064  1588543350000    0.0  docker_002\n24564  container_thread_total  ZJ-004-064  1588543385000    0.0  docker_002\n24641  container_thread_total  ZJ-004-064  1588543471000    0.0  docker_002\n24713  container_thread_total  ZJ-004-064  1588543531000    0.0  docker_002\n24793  container_thread_total  ZJ-004-064  1588543591000    0.0  docker_002\n24863  container_thread_total  ZJ-004-064  1588543651000    0.0  docker_002\n                            name     bomc_id      timestamp  value     cmdb_id\n23679  container_thread_used_pct  ZJ-004-061  1588542631000    0.0  docker_002\n23742  container_thread_used_pct  ZJ-004-061  1588542692000    0.0  docker_002\n23805  container_thread_used_pct  ZJ-004-061  1588542751000    0.0  docker_002\n23859  container_thread_used_pct  ZJ-004-061  1588542810000    0.0  docker_002\n23940  container_thread_used_pct  ZJ-004-061  1588542870000    0.0  docker_002\n23979  container_thread_used_pct  ZJ-004-061  1588542903000    0.0  docker_002\n24068  container_thread_used_pct  ZJ-004-061  1588542991000    0.0  docker_002\n24153  container_thread_used_pct  ZJ-004-061  1588543050000    0.0  docker_002\n24230  container_thread_used_pct  ZJ-004-061  1588543111000    0.0  docker_002\n24282  container_thread_used_pct  ZJ-004-061  1588543171000    0.0  docker_002\n24359  container_thread_used_pct  ZJ-004-061  1588543233000    0.0  docker_002\n24427  container_thread_used_pct  ZJ-004-061  1588543263000    0.0  docker_002\n24499  container_thread_used_pct  ZJ-004-061  1588543350000    0.0  docker_002\n24562  container_thread_used_pct  ZJ-004-061  1588543385000    0.0  docker_002\n24638  container_thread_used_pct  ZJ-004-061  1588543471000    0.0  docker_002\n24710  container_thread_used_pct  ZJ-004-061  1588543531000    0.0  docker_002\n24786  container_thread_used_pct  ZJ-004-061  1588543591000    0.0  docker_002\n24852  container_thread_used_pct  ZJ-004-061  1588543651000    0.0  docker_002\n"
     ]
    }
   ],
   "source": [
    "d2_df = d2_df.drop('itemid',axis=1)\n",
    "for name in d2_df.name.unique():\n",
    "    print(d2_df[d2_df['name']==name])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ]
}